Uri.HexUnescape(String, Int32) Metoda

Definice

Převede zadanou šestnáctkovou reprezentaci znaku na znak.

public:
 static char HexUnescape(System::String ^ pattern, int % index);
public static char HexUnescape (string pattern, ref int index);
static member HexUnescape : string * int -> char
Public Shared Function HexUnescape (pattern As String, ByRef index As Integer) As Char

Parametry

pattern
String

Hexadecimální reprezentace znaku.

index
Int32

Umístění, ve pattern kterém začíná šestnáctkové znázornění znaku.

Návraty

Znak reprezentovaný šestnáctkovým kódováním na pozici index. Pokud znak v index není šestnáctkové kódování, vrátí se znak v index . Hodnota je index zvyšována tak, aby odkazovala na znak následující za vráceným znakem.

Výjimky

index je menší než 0 nebo větší než nebo rovna počtu znaků v patternsouboru .

Poznámky

Následující příklad kódu určuje, zda je znak v šestnáctkovém kódování, a pokud ano, zapíše ekvivalentní znak do konzoly.

String^ testString = "%75";
int index = 0;
if ( Uri::IsHexEncoding( testString, index ) )
{
   Console::WriteLine( "The character is {0}",
      Uri::HexUnescape( testString, index ) );
}
else
{
   Console::WriteLine( "The character is not hex encoded" );
}
string testString = "%75";
int index = 0;
if (Uri.IsHexEncoding(testString, index))
     Console.WriteLine("The character is {0}", Uri.HexUnescape(testString, ref index));
else
     Console.WriteLine("The character is not hexadecimal encoded");
let testString = "%75"
let mutable index = 0
if Uri.IsHexEncoding(testString, index) then
    printfn $"The character is {Uri.HexUnescape(testString, &index)}"
else
    printfn "The character is not hexadecimal encoded"
Dim testString As String = "%75"
Dim index As Integer = 0
If Uri.IsHexEncoding(testString, index) Then
    Console.WriteLine("The character is {0}", Uri.HexUnescape(testString, index))
Else
    Console.WriteLine("The character is not hexadecimal encoded")
End If

Platí pro