Home » C#

C# | Uri.HexUnescape() Method with Example

Uri.HexUnescape() Method: Here, we are going to learn about the HexUnescape() method of Uri class with example in C#.
Submitted by Nidhi, on March 26, 2020

Uri.HexUnescape() Method

Uri.HexUnescape() method is a static method that is used to convert the hexadecimal representation of a character to the character.

Syntax:

    char Uri.HexUnescape (string str, ref int index);

Parameter(s):

  • string str – represents the hexadecimal string.
  • ref int index – represents a ref variable for index.

Return value:

The return type of this method is char, it returns the character value of the specified character from the given hexadecimal string.

Exception:

    System.ArgumentOutOfRangeException;

Example to demonstrate example of Uri.HexUnescape() method

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        string str     = "%44";
        char retChar;
        int index      =    0;


        retChar = Uri.HexUnescape(str,ref index);
        
        Console.WriteLine("Hexadecimal character: "+retChar);
    }
}

Output

Hexadecimal character: D
Press any key to continue . . .





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.