Uri.HexUnescape() Method in C# with Examples Last Updated : 08 Jun, 2020 Comments Improve Suggest changes Like Article Like Report Uri.HexUnescape() method is used to convert a specified hexadecimal representation of a character to the character. Syntax: public static char HexUnescape (string pattern, ref int index); Parameters: string str – This represents the hexadecimal string.ref int index – This represents location in pattern where the hexadecimal representation of a character begins. Return value: This method returns the character represented by the hexadecimal encoding at position index. If the character at index is not hexadecimal encoded, the character at index is returned. The value of index is incremented to point to the character following the one returned. Exception: This method throws ArgumentOutOfRangeException if index is less than 0 or greater than or equal to the number of characters. Example 1: C# // C# program to demonstrate the // Uri.HexUnescape() method using System; class GFG { // Main Method public static void Main() { // Declaring and initializing string str = "%70"; char retChar; int index = 0; // using HexUnescape() method retChar = Uri.HexUnescape(str,ref index); Console.WriteLine("Hexadecimal character: "+retChar); } } Output: Hexadecimal character: p Example 2: C# // C# program to demonstrate the // Uri.HexUnescape() method using System; class GFG { // Main Method public static void Main() { // Declaring and initializing string str = Convert.ToString(123, 16); char retChar; int index = 0; // using HexUnescape() method retChar = Uri.HexUnescape(str,ref index); Console.WriteLine("Hexadecimal character: "+retChar); } } Output: Hexadecimal character: 7 Comment More infoAdvertise with us Next Article Uri.Fragment Property in C# with Examples S shivanisinghss2110 Follow Improve Article Tags : C# CSharp-Uri-Class Similar Reads Uri.GetLeftPart() Method in C# with Examples Uri.GetLeftPart() Method is an instance method that is used to get a specified part from the given URI based on passed UriPartial enum. Syntax: string Uri.GetLeftPart (UriPartial Part); Parameters: Part: It represents UriPartial to get specified part from Uri. Return Value: This method returns strin 2 min read C# | Uri.HexEscape(Char) Method Uri.HexEscape(Char) Method is used to convert a specified character into its hexadecimal equivalent. Syntax: public static string HexEscape (char character); Here, it takes the character to convert to hexadecimal representation. Return Value: This method returns the hexadecimal representation of the 1 min read Uri.Fragment Property in C# with Examples Uri.Fragment Property is instance property which is used to get the escaped URI fragment. Syntax: public string Fragment { get; } Return value: This property returns string that contains any URI fragment information. Exception: This property throws InvalidOperationException for a relative URI and is 1 min read Uri.Equality() Operator in C# with Examples Uri.Equality() Operator is used to compare two Uri objects. If two Uri objects contain the same Uri, then it returns the true otherwise it returns false. Syntax: public static bool operator == (Uri uri1, Uri uri2); Parameter: This method has the following parameters: uri1: This parameter is the firs 2 min read UInt64.ToString Method in C# with Examples | Set - 2 UInt64.ToString Method is used to convert the numeric value of the current instance to its equivalent string representation. There are 4 methods in the overload list of this method as follows: ToString(IFormatProvider) Method ToString(String, IFormatProvider) Method ToString() Method ToString(String 2 min read UInt16.ToString Method in C# with Examples | Set - 2 UInt16.ToString Method is used to convert the numeric value of the current instance to its equivalent string representation. There are 4 methods in the overload list of this method as follows: ToString(IFormatProvider) Method ToString(String, IFormatProvider) Method ToString() Method ToString(String 2 min read Like