Uri.HexEscape(Char) Uri.HexEscape(Char) Uri.HexEscape(Char) Uri.HexEscape(Char) Method

Definition

Konvertiert ein angegebenes Zeichen in die entsprechende Hexadezimaldarstellung.Converts a specified character into its hexadecimal equivalent.

public:
 static System::String ^ HexEscape(char character);
public static string HexEscape (char character);
static member HexEscape : char -> string
Public Shared Function HexEscape (character As Char) As String

Parameter

character
Char Char Char Char

Das in die Hexadezimaldarstellung zu konvertierende Zeichen.The character to convert to hexadecimal representation.

Gibt zurück

Die Hexadezimaldarstellung des angegebenen Zeichens.The hexadecimal representation of the specified character.

Ausnahmen

Beispiele

Im folgende Beispiel konvertiert ein Zeichen in die hexadezimale Entsprechung und schreibt sie in der Konsole.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 );
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 hexadecimal character", testChar);

string returnString = Uri.HexEscape(testChar);
Console.WriteLine("The hexadecimal value of '{0}' is {1}", testChar, returnString);
Dim testChar As Char = "e"c
If Uri.IsHexDigit(testChar) = True Then
    Console.WriteLine("'{0}' is the hexadecimal representation of {1}", testChar, Uri.FromHex(testChar))
Else
    Console.WriteLine("'{0}' is not a hexadecimal character", testChar)
End If 
Dim returnString As String = Uri.HexEscape(testChar)
Console.WriteLine("The hexadecimal value of '{0}' is {1}", testChar, returnString)

Gilt für: