Uri.HexUnescape(String, Int32) メソッド

定義

指定した文字の 16 進数表現を文字に変換します。

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

パラメーター

pattern
String

文字の 16 進数表現。

index
Int32

文字の 16 進表現が始まる pattern 内の位置。

返品

index位置にある 16 進エンコードで表される文字。 indexの文字が 16 進数でエンコードされていない場合は、indexの文字が返されます。 indexの値は、返された文字の後の文字を指すようにインクリメントされます。

例外

index が 0 未満か、 patternの文字数以上です。

注釈

次のコード例では、文字が 16 進数でエンコードされているかどうかを判断し、エンコードされている場合は、同等の文字をコンソールに書き込みます。

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

適用対象