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!

Char.CompareTo

Compares this instance to the specified object.

[Visual Basic]
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 for comparison with this instance.

Return Value

Value Description
A negative integer If this instance is less than the object.
Zero If this instance and the object are equal.
A positive integer If this instance is greater than the object.
A positive integer If the object is null. This is a special case.

Exceptions

Exception Type Condition
ArgumentException if the object is not null reference and not a Char.

Remarks

In the comparison of two Char values, the Unicode hexadecimal character codes are used to determine the ordering. As a special case, an instance is considered to be greater than a null reference regardless of its value.

The value parameter must be either a Char type or a null reference; otherwise an exception is thrown. Null is considered to be less than this instance.

See Also

Char Structure | Char Members | System Namespace | Object