Windows Dev Center

IComparer Interface

Exposes a method that compares two objects.

Namespace:  System.Collections
Assembly:  mscorlib (in mscorlib.dll)

public interface IComparer

The IComparer type exposes the following members.

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

This interface is used in conjunction with the Array.Sort and Array.BinarySearch methods. It provides a way to customize the sort order of a collection.

For the generic version of this interface, see System.Collections.Generic.IComparer<T>.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2015 Microsoft