R
Ramiro Calderon Romero
Hi list,
I don't know if I'm doing something wrong here.
Check out this code snippet:
class App
{
static void Main()
{
string a = "the fellowship of the ring";
string b = "The two towers";
int n = string.Compare(a,b,true);
int m = string.Compare(a,b,false);
Console.WriteLine("n={0}, m={1}",n,m);
}
}
I would expect n = -1 (I'm ignoring case here) and m = 1 (because 'T' <
't'). However I'm getting n = m = -1;
Am I wrong or it's just a weird non-intuitive behavior in the
String::Compare method?
Regards,
Ramiro
I don't know if I'm doing something wrong here.
Check out this code snippet:
class App
{
static void Main()
{
string a = "the fellowship of the ring";
string b = "The two towers";
int n = string.Compare(a,b,true);
int m = string.Compare(a,b,false);
Console.WriteLine("n={0}, m={1}",n,m);
}
}
I would expect n = -1 (I'm ignoring case here) and m = 1 (because 'T' <
't'). However I'm getting n = m = -1;
Am I wrong or it's just a weird non-intuitive behavior in the
String::Compare method?
Regards,
Ramiro