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 (Object)

Compares this instance with the specified Object.

[Visual Basic]
Overloads Overridable Public Function CompareTo( _
   ByVal value As Object _
) As Integer
[C#]
public virtual int CompareTo(
   object value
);
[C++]
public: virtual int CompareTo(
   Object* value
);
[JScript]
public function CompareTo(
   value : Object
) : int;

Parameters

value
The object compared with this instance.

Return Value

Value Condition
A negative integer If the object sorts before this instance.
Zero If the objects sort equally.
A positive integer If the object sorts after this instance.

Exceptions

Exception Type Condition
ArgumentException If the object is not a string.

Remarks

The comparison of two string values is case-sensitive and uses the CultureInfo of the current thread to determine the ordering.

An instance of string is considered to be greater than any object that is not a string. In particular, an instance of String is considered to be greater than a null reference. Note that sorted arrays with nulls, objects, and strings would put in that order. A null string sorts less than all the others.

See Also

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