D
Dat K. AU DUONG
Hi,
C# Annoying string function or Am I doing Something wrong?
In VB6/VB.NET I can code like:
value = value.trim()
and it just work!
But in c#, I event put in the additional check I still get the error.
if (value.Length > 0 && value != string.Empty){
value = value.trim();
}
The error message:
startIndex cannot be larger than length of string.
Parameter name: startIndex at
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32
length, Boolean fAlwaysCopy) ...
Please Help!
Thanks.
Regards Dat.
C# Annoying string function or Am I doing Something wrong?
In VB6/VB.NET I can code like:
value = value.trim()
and it just work!
But in c#, I event put in the additional check I still get the error.
if (value.Length > 0 && value != string.Empty){
value = value.trim();
}
The error message:
startIndex cannot be larger than length of string.
Parameter name: startIndex at
System.String.InternalSubStringWithChecks(Int32 startIndex, Int32
length, Boolean fAlwaysCopy) ...
Please Help!
Thanks.
Regards Dat.