H
Helge Jensen
In my locale (US-english/DK i think, dunno how to state it properly
,
..NET-1.1-sp1 I observe the following:
"A".CompareTo("B") == -1; // A < B
"B".CompareTo("F") == -1; // B < F
"A".CompareTo("F") == -1; // A < F
Seems like lexicographic order, and also:
"BB".CompareTo("FF") == 1; // BB < FF
So that's looking as a usual lexicographic order, but, much to my surprise:
"AA".CompareTo("BB") == 1; // AA > BB
"AA".CompareTo("FF") == 1; // AA > FF
The documentation says that string.CompareTo returns: "A 32-bit signed
integer indicating the lexical relationship between the two comparands."
What's going on here, am I misinterpreting, or is this a bug?

..NET-1.1-sp1 I observe the following:
"A".CompareTo("B") == -1; // A < B
"B".CompareTo("F") == -1; // B < F
"A".CompareTo("F") == -1; // A < F
Seems like lexicographic order, and also:
"BB".CompareTo("FF") == 1; // BB < FF
So that's looking as a usual lexicographic order, but, much to my surprise:
"AA".CompareTo("BB") == 1; // AA > BB
"AA".CompareTo("FF") == 1; // AA > FF
The documentation says that string.CompareTo returns: "A 32-bit signed
integer indicating the lexical relationship between the two comparands."
What's going on here, am I misinterpreting, or is this a bug?