C# Uri HexEscape
Description
Uri HexEscape
converts a specified character into its
hexadecimal equivalent.
Syntax
Uri.HexEscape
has the following syntax.
public static string HexEscape(
char character
)
Parameters
Uri.HexEscape
has the following parameters.
character
- The character to convert to hexadecimal representation.
Returns
Uri.HexEscape
method returns The hexadecimal representation of the specified character.
Example
The following example converts a character to its hexadecimal equivalent and writes it to the console.
//w w w . ja v a 2 s.com
using System;
public class MainClass{
public static void Main(String[] argv){
char testChar = 'e';
string returnString = Uri.HexEscape(testChar);
Console.WriteLine(returnString);
}
}
The code above generates the following result.