Char.IComparable.CompareTo Method
.NET Framework 4.5
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
- Type: System.Object
An object to compare this instance to, or null.
Return Value
Type: System.Int32A signed integer that indicates the position of this instance in the sort order in relation to the value parameter.
Return value | Description |
|---|---|
Less than zero | This instance precedes value in the sort order. |
Zero | This instance has the same position in the sort order as value. |
Greater than zero | This instance follows value in the sort order. -or- value is null. |
Implements
IComparable.CompareTo(Object)| Exception | Condition |
|---|---|
| ArgumentException | value is not a Char object. |
This member is an explicit interface implementation. It can be used only when the Char instance is cast to an IComparable interface.