All comparisons in this document are case sensitive.
In C ++:
"A" <"A": True
"AA" <"A": True
"AA" <"AA": True
"AA" <"AA": True
"AC" <"AB": True
Obviously, in C ++, string comparison follows the following two rules:
1. Lower case <upper case
2. Comparison from the beginning to the back. This deduction is to ignore the overall length.
I personally think this is very reasonable, that is, the way the English dictionary is sorted.
But let's look at the results in. net.
String: Compare ("A", "A"):-1
String: Compare ("AA", "A"): 1 //. Net considers the overall length.
String: Compare ("AA", "AA"):-1
String: Compare ("AA", "AA"):-1
String: Compare ("AC", "AB"): 1 // This is the least I can understand. It is case-sensitive. Why does. Net ignore the differences between the first a and even the second character?
I don't know if there are any other string comparison methods in. net? It is difficult to sort dictionaries using this method.
If Microsoft's comparison result is by design, what kind of actual environment does Microsoft target?