Mono Class Library: System.Char Overview | Members

System.Char.CompareTo Method

Returns the sort order of the current instance compared to the specified char . [Edit]

public int CompareTo (char value)

Parameters

value
Documentation for this section has not yet been entered. [Edit]

Returns

The return value is a negative number, zero, or a positive number reflecting the sort order of the current instance as compared to value. For non-zero return values, the exact value returned by this method is unspecified. The following table defines the return value:

Return ValueDescription
A negative numberCurrent instance < value.
ZeroCurrent instance == value.
A positive numberCurrent instance > value.
[Edit]

Remarks

The comparison performed by this method is based on the code points of the current instance and value, not necessarily their lexicographical characteristics.

Note: This method is implemented to support the IComparable<Char> interface.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0