Mono Class Library: System.String Overview | MembersSystem.String.CompareOrdinal Method |
Compares substrings of two specified string objects based on the code points of the contained Unicode characters. [Edit]
|
- strA
- The first string to compare. [Edit]
- indexA
- A int containing the starting index of the substring in strA. [Edit]
- strB
- The second string to compare. [Edit]
- indexB
- A int containing the starting index of the substring in strB. [Edit]
- length
- A int containing the number of characters in the substrings to compare. [Edit]
The return value is a negative number, zero, or a positive number reflecting the sort order of the specified strings. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:
[Edit]
Value Type Condition A negative number The substring in strA is < the substring in strB, or strA is a null reference. Zero The substring in strA == the substring in strB, or both strA and strB are null references. A positive number The substring in strA is > the substring in strB, or strB is a null reference.
Type Reason ArgumentOutOfRangeException indexA is greater than strA .Length
-or-
indexB is greater than strB .Length
-or-
indexA, indexB, or lengthis negative.
[Edit]
When either of the String arguments is the null reference an ArgumentOutOfRangeException shall be thrown if the corresponding index is non-zero.
Note:[Edit]The maximum number of characters compared is the lesser of the length of strA less indexA, the length of strB less indexB, and length.
The result of comparing any string (including the empty string) to a null reference is greater than zero. The result of comparing two null references is zero. Upper case 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.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0