Comparer

Comparer CF 1.0, ECMA 1.0, serializable

System.Collections (mscorlib.dll) sealed class

The Comparer class is used to compare two objects of the same type. The Compare( ) method takes two objects. If the first object is less than the second, a negative value is returned. If the first object is greater than the second, a positive value is returned. If the objects are equal, zero is returned. The comparisons of strings are case-sensitive. For case-insensitive string comparisons, use CaseInsensitiveComparer . You can obtain a standard comparer that uses the System.Globalization.InvariantCulture rules for string comparisons by using the CaseInsensitiveComparer instance returned from the static DefaultInvariant property.

 public sealed class  Comparer  : IComparer {  // Public Constructors  public  Comparer  (System.Globalization.CultureInfo   culture   );  // Public Static Fields  public static readonly Comparer  Default  ;  // =System.Collections.Comparer  public static readonly Comparer  DefaultInvariant  ;  // =System.Collections.Comparer   // Public Instance Methods  public int  Compare  (object   a   , object   b   );  // implements IComparer  } 


C# in a Nutshell
C # in a Nutshell, Second Edition
ISBN: 0596005261
EAN: 2147483647
Year: 2005
Pages: 963

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net