O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

CaseInsensitiveHashCodeProvider

Synopsis

When this object is passed to a Hashtable constructor, it overrides the GetHashCode() method to allow string comparison without regard to case. If you pass an instance of this type into the Hashtable constructor, you should also pass in an instance of CaseInsensitiveComparer to ensure that any comparison operations (such as sorting) are also performed in a case-insensitive fashion.

public class CaseInsensitiveHashCodeProvider : IHashCodeProvider {
// Public Constructors
   public method CaseInsensitiveHashCodeProvider();  
   public method CaseInsensitiveHashCodeProvider(
        System.Globalization.CultureInfo culture);  
// Public Static Properties

           public static field CaseInsensitiveHashCodeProvider Default{get; } 
// Public Instance Methods
   public method int GetHashCode(object obj);                   // implements IHashCodeProvider
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required