← Interactive API Explorer
Namespace: System.Collections.Generic

Comparer<T>

Provides a base class for implementations of the IComparer generic interface.

Properties (1)

Comparer<T> Default
Returns a default sort order comparer for the type specified by the generic argument.
Value: An object that inherits Comparer and serves as a sort order comparer for type T.

Methods (1)

int Compare(T,T)
When overridden in a derived class, performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other.
ParameterDescription
xThe first object to compare.
yThe second object to compare.
Returns: A signed integer that indicates the relative values of x and y, as shown in the following table. Value Meaning Less than zero x is less than y. Zero x equals y. Greater than zero x is greater than y.