Skip to content
CShift0.32

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.

Name Description
CompareTo Compares this value with another one.
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.