GetHashCode Method (Object)
Collapse the table of content
Expand the table of content

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.

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:
© 2017 Microsoft