Mono Class Library: System.String Overview | MembersSystem.String.CompareTo Method |
Returns the sort order of the current instance compared to the specified string. [Edit]
|
The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to strB. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:
[Edit]
Value Condition A negative number The current instance is lexicographically < strB. Zero The current instance is lexicographically == strB. A positive number The current instance is lexicographically > strB, or strB is a null reference.
Note:[Edit]Uppercase letters evaluate greater than their lowercase equivalents.
The method uses the culture (if any) of the current thread to determine the ordering of individual characters. The two strings are compared on a character-by-character basis.
This method is implemented to support the IComparable<string> interface.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0