Uri.HexUnescape(String, Int32) Méthode

Définition

Convertit une représentation hexadécimale spécifiée d'un caractère en ce caractère.

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

Paramètres

pattern
String

Représentation hexadécimale d'un caractère.

index
Int32

Emplacement dans pattern où la représentation hexadécimale d'un caractère commence.

Retours

Char

Caractère représenté par l'encodage hexadécimal à la position index. Si le caractère à la position index n'a pas un encodage hexadécimal, le caractère à la position index est retourné. La valeur de index est incrémentée pour pointer vers le caractère suivant celui qui est retourné.

Exceptions

index est inférieur à 0 ou supérieur ou égal au nombre de caractères contenus dans pattern.

Remarques

L’exemple de code suivant détermine si un caractère est codé hexadécimal et, le cas échéant, écrit le caractère équivalent dans la console.

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

S’applique à