Mono Class Library: System.String Overview | MembersSystem.String.CompareTo Method |
Returns the sort order of the current instance compared to the specified object. [Edit]
|
The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to value. 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 < value. Zero The current instance is lexicographically == value. A positive number The current instance is lexicographically > value, or value is a null reference.
Type Reason ArgumentException value is not a string. [Edit]
value is required to be a string object.
Note:[Edit]The result of comparing any string (including the empty string) to a null reference is greater than zero. 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 interface.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0