Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Uri::HexEscape Method (Char)

 

Converts a specified character into its hexadecimal equivalent.

Namespace:   System
Assembly:  System (in System.dll)

public:
static String^ HexEscape(
	wchar_t character
)

Parameters

character
Type: System::Char

The character to convert to hexadecimal representation.

Return Value

Type: System::String^

The hexadecimal representation of the specified character.

Exception Condition
ArgumentOutOfRangeException

character is greater than 255.

The following example converts a character to its hexadecimal equivalent and writes it to the console.

char testChar = 'e';
if ( Uri::IsHexDigit( testChar ) == true )
{
   Console::WriteLine( "'{0}' is the hexadecimal representation of {1}",
      testChar, Uri::FromHex( testChar ) );
}
else
{
   Console::WriteLine( "'{0}' is not a hex character", testChar );
}

String^ returnString = Uri::HexEscape( testChar );
Console::WriteLine( "The hexadecimal value of '{0}' is {1}", testChar, returnString );

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft