StringComparer.GetHashCode Method (Object)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
When overridden in a derived class, gets the hash code for the specified object.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- obj
- Type: System.Object
An object.
Return Value
Type: System.Int32A 32-bit signed hash code calculated from the value of the obj parameter.
Implements
IEqualityComparer.GetHashCode(Object)| Exception | Condition |
|---|---|
| ArgumentException | Not enough memory is available to allocate the buffer required to compute the hash code. |
| ArgumentNullException | obj is Nothing. |
The GetHashCode method is more efficient than the GetHashCode method because the obj parameter does not have to be unboxed to perform the operation.
Show: