CorString: CompareOrdinalEx |
Compares substrings of two specified String objects by evaluating the numeric values of the corresponding Char objects in each substring.
Public Function CompareOrdinalEx( ByRef StrA As String, ByVal IndexA As Long, ByRef StrB As String, ByVal IndexB As Long, ByVal Length ) As Long
Value | Condition |
---|---|
Less than zero | The substring in the StrA parameter is less than the substring in the StrB parameter. |
Zero | The substrings are equal, or the Length parameter is zero. |
Greater than zero | The substring in StrA is greater than the substring in StrB. |
The IndexA, IndexB, and Length parameters must be nonnegative.
The number of characters compared is the lesser of the length of StrA less IndexA, the length of StrB less IndexB, and Length.
Exception | Condition |
---|---|
ArgumentOutOfRangeException |
IndexA is greater than StrA length. -or- IndexB is greater than StrB length. -or- IndexA, IndexB, or Length is negative. -or- Either StrA or StrB is empty, and Length is greater than zero. |