System Namespace String Class
Compares two specified String objects, without considering the local national language or culture.
[ VB ]
<Serializable>
Overloads Public Shared Function CompareOrdinal ( _
ByVal strA As String, _
ByVal strB As String _
) As Integer
[ C# ]
[ Serializable ]
public static int CompareOrdinal (
string strA,
string strB
);
[ C++ ]
[ Serializable ]
public: static int CompareOrdinal (
String* strA,
String* strB
);
[ JScript ]
public Serializable
static function CompareOrdinal (
strA : String,
strB : String
) : int;
- strA
- The first String.
- strB
- The second String.
An integer indicating the lexical relationship between the two comparands.
Permission |
Description |
Less than zero |
strA is less than strB. |
Zero |
strA and strB are equal. |
Greater than zero |
strA is greater than strB. |
By definition, any String, including the empty string, compares greater than a null reference ( Nothing in Visual Basic ); and two null references compare equal to each other.
String Members String.CompareOrdinal Overload List Int32 Compare CompareTo