StringComparer.GetHashCode Method (Object)

July 28, 2014

When overridden in a derived class, gets the hash code for the specified object.

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

public int GetHashCode(
	Object obj
)

Parameters

obj
Type: System.Object
An object.

Return Value

Type: System.Int32
A 32-bit signed hash code calculated from the value of the obj parameter.

Implements

IEqualityComparer.GetHashCode(Object)

ExceptionCondition
ArgumentException

Not enough memory is available to allocate the buffer required to compute the hash code.

ArgumentNullException

obj is null.

The GetHashCode method is more efficient than the GetHashCode method because the obj parameter does not have to be unboxed to perform the operation.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft