NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

String.CompareTo (String)

Compares and determines the sorting order of this instance and the specified string.

[Visual Basic]
Overloads Public Function CompareTo( _
   ByVal strB As String _
) As Integer
[C#]
public int CompareTo(
   string strB
);
[C++]
public: int CompareTo(
   String* strB
);
[JScript]
public function CompareTo(
   strB : String
) : int;

Parameters

strB
The string compared with this instance.

Return Value

Value Condition
A negative integer If this instance is less than the string.
Zero If this instance and the string have the same value.
A positive integer If this instance is greater than the string.
A positive integer If the string is null.

Remarks

The comparison of two string values is case-sensitive and uses the CultureInfo of the current thread to determine the ordering. As a special case, an instance of string is considered to be greater than a null reference.

See Also

String Class | String Members | System Namespace | String.CompareTo Overload List | Int32