System.Collections.CaseInsensitiveHashCodeProvider Class

Supplies a hash code for an object, using a hashing algorithm that ignores the case of strings.

See Also: CaseInsensitiveHashCodeProvider Members


[System.Obsolete("Please use StringComparer instead.")]
public class CaseInsensitiveHashCodeProvider : IHashCodeProvider


CaseInsensitiveHashCodeProvider implements the IHashCodeProvider interface supporting case-insensitive comparisons on strings, just as CaseInsensitiveComparer implements the IComparer interface supporting case-insensitive comparisons on strings.

The objects used as keys by a Hashtable are required to override the object.GetHashCode method (or the IHashCodeProvider interface) and the object.Equals(object) method (or the IComparer interface). The implementation of both methods or interfaces must handle case sensitivity the same way; otherwise, the Hashtable might behave incorrectly. For example, when creating a Hashtable, you must use this class with the CaseInsensitiveComparer class or any case-insensitive IComparer implementation.


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