C# StringComparer GetHashCode(String)
Description
StringComparer GetHashCode(String)
when overridden
in a derived class, gets the hash code for the specified string.
Syntax
StringComparer.GetHashCode(String)
has the following syntax.
public abstract int GetHashCode(
string obj
)
Parameters
StringComparer.GetHashCode(String)
has the following parameters.
obj
- A string.
Returns
StringComparer.GetHashCode(String)
method returns A 32-bit signed hash code calculated from the value of the obj parameter.
Example
using System;// w ww.jav a2 s . 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.