Method CompareToOrdinal
CompareToOrdinal(String, String)
This method mimics the Java String.compareTo(String) method in that it
- Compares the strings using lexographic sorting rules
- Performs a culture-insensitive comparison
>
or <
.
Declaration
public static int CompareToOrdinal(this string str, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | str | |
System.String | value | The string to compare with. |
Returns
Type | Description |
---|---|
System.Int32 | An integer that indicates the lexical relationship between the two comparands. Less than zero indicates the comparison value is greater than the current string. Zero indicates the strings are equal. Greater than zero indicates the comparison value is less than the current string. |