Uri.HexUnescape(String, Int32) Metoda

Definicja

Konwertuje określoną reprezentację szesnastkowa 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

Reprezentacja szesnastkowa znaku.

index
Int32

Lokalizacja, w pattern której rozpoczyna się reprezentacja szesnastkowa znaku.

Zwraca

Char

Znak reprezentowany przez kodowanie szesnastkowe na pozycji index. Jeśli znak w obiekcie index nie jest zakodowany szesnastkowym, zwracany jest znak .index Wartość jest index zwiększana, aby wskazywała znak po zwróconym znaku.

Wyjątki

index jest mniejsza niż 0 lub większa niż lub równa liczbie znaków w patternelemecie .

Uwagi

Poniższy przykład kodu określa, czy znak jest zakodowany szesnastkowy, a jeśli tak, zapisuje równoważny znak do konsoli.

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

Dotyczy