Table of Contents

Interface IComparer

Namespace
System.Collections
Assembly
mscorlib.dll

Exposes a method that compares two objects.

public interface IComparer
Extension Methods

Methods

Compare(object, object)

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

int Compare(object x, object y)

Parameters

x object

The first object to compare.

y object

The second object to compare.

Returns

int

A signed integer that indicates the relative values of x and y, as shown in the following table.

Less than zero : x is less than y.

Zero : x equals y.

Greater than zero : x is greater than y.