System Namespace String Class
Compares this instance with a specified String object.
[ VB ]
<Serializable>
Overloads Public Function CompareTo ( _
ByVal strB As String _
) As Integer
[ C# ]
[ Serializable ]
public int CompareTo (
string strB
);
[ C++ ]
[ Serializable ]
public: int CompareTo (
String* strB
);
[ JScript ]
public Serializable
function CompareTo (
strB : String
) : int;
- strB
- A String.
A 32-bit signed integer indicating the lexical relationship between the two comparands.
Value |
Condition |
Less than zero |
This instance is less than value. |
Zero |
This instance is equal to value. |
Greater than zero |
This instance is greater than value.
-or-
value is a null reference ( Nothing in Visual Basic ).
|
By definition, any String, including the empty string, compares greater than a null reference; and two null references compare equal to each other.
String Members String.CompareTo Overload List Compare CompareOrdinal