System.Uri.HexEscape Method

Converts a specified character into its hexadecimal equivalent.

Syntax

public static string HexEscape (char character)

Parameters

character
The character to convert to hexadecimal representation.

Returns

The hexadecimal representation of the specified character.

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe numerical value of character is greater than 255.

Remarks

The returned string is in the form "%XX", where X represents a hexadecimal digit (0-9, A-F).

Requirements

Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0