K
Kapil Sachdeva
Hi Guys:
Here is a snippet of code
char[] ch = new char[5];
ch[0] = 'A';
ch[1] = 'B'; // ch[2], ch[3], ch[4] are ' '
String _str = new String(ch);
int res = _str.CompareTo("AB");
If I run I get res == 0.
So does this mean that CompareTo method trims the whitespaces before and
after the string
which is to be compared ?
I am confused about this as the MSDN documentation about the function does
not say so.
Would be grateful if someone could validate my interpretation and incorrect
documentation
Regards & Thanks
Kapil
Here is a snippet of code
char[] ch = new char[5];
ch[0] = 'A';
ch[1] = 'B'; // ch[2], ch[3], ch[4] are ' '
String _str = new String(ch);
int res = _str.CompareTo("AB");
If I run I get res == 0.
So does this mean that CompareTo method trims the whitespaces before and
after the string
which is to be compared ?
I am confused about this as the MSDN documentation about the function does
not say so.
Would be grateful if someone could validate my interpretation and incorrect
documentation
Regards & Thanks
Kapil