Exposes a method that compares two objects.

See Also: IComparer Members


public interface IComparer


This interface is used in conjunction with the Array.Sort(Array) and Array.BinarySearch(Array, object) methods. It provides a way to customize the sort order of a collection. See the IComparer.Compare(object, object) method for notes on parameters and return value.

The default implementation of this interface is the Comparer class. For the generic version of this interface, see IComparer`1.


Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0,,