C# StringComparer GetHashCode(Object)
Description
StringComparer GetHashCode(Object)
when overridden
in a derived class, gets the hash code for the specified object.
Syntax
StringComparer.GetHashCode(Object)
has the following syntax.
public int GetHashCode(
Object obj
)
Parameters
StringComparer.GetHashCode(Object)
has the following parameters.
obj
- An object.
Returns
StringComparer.GetHashCode(Object)
method returns A 32-bit signed hash code calculated from the value of the obj parameter.
Example
using System;//from ww w . j a v a 2s .c o m
class Sample
{
public static void Main()
{
StringComparer invCmp = StringComparer.Ordinal;
Console.WriteLine(invCmp.GetHashCode("asdf"));
}
}
The code above generates the following result.