IComparable<T>
Interface · global namespace
interface IComparable<T>Values that have an order: List<T>.Sort and the comparison of keys use it.
Numbers, char and string implement it, and so can any struct that defines CompareTo.
Methods
Section titled “Methods”| Name | Description |
|---|---|
CompareTo |
Compares this value with another one. |
CompareTo
Section titled “CompareTo”int CompareTo(T other)Compares this value with another one.
Returns a negative number if this value comes before other, 0 if they are equal, a positive number if it comes after.