C# | Uri.GetHashCode() Method
Uri.GetHashCode() Method is used to get the hash code for the URI.
Syntax: public override int GetHashCode ();
Return Value: This method returns an Int32 containing the hash value generated for this URI.
Below programs illustrate the use of Uri.GetHashCode() Method:
Example 1:
using System;
using System.Globalization;
class GFG {
public static void Main()
{
int value = address1.GetHashCode();
Console.WriteLine( "HashCode is : {0}" , value);
}
}
|
Output:
HashCode is : 2065713268
Example 2:
using System;
using System.Globalization;
class GFG {
public static void Main()
{
}
public static void get (Uri address1)
{
int value = address1.GetHashCode();
Console.WriteLine( "HashCode is : {0}" , value);
}
}
|
Output:
HashCode is : 2014
HashCode is : 1498
Reference:
Last Updated :
01 May, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...