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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version