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 specified character.
Exception: This method throws ArgumentOutOfRangeException if character is greater than 255.
Below programs illustrate the use of Uri.HexEscape(Char) Method:
Hexadecimal Equivalent is: %63
Note: Character greater than 255 is not practically possible.
- Difference between Method Overriding and Method Hiding in C#
- C# | Remove() Method
- Queue.Contains() Method in C#
- DateTimeOffset.Add() Method in C#
- C# | Math.Abs() Method | Set - 1
- C# | Math.Abs() Method | Set - 2
- C# | Math.Exp() Method
- Anonymous Method in C#
- TimeSpan.Add() Method in C#
- C# | Uri.FromHex() Method
- C# | String.Contains() Method
- C# | Random.Next() Method
- C# | Uri.IsHexDigit() Method
- C# | Math.Tan() Method
- C# | IndexOfAny() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.