Uri.IsHexEncoding(String, Int32) 메서드

정의

문자열의 문자가 16진수로 인코딩되었는지 여부를 확인합니다.Determines whether a character in a string is hexadecimal encoded.

public:
 static bool IsHexEncoding(System::String ^ pattern, int index);
public static bool IsHexEncoding (string pattern, int index);
static member IsHexEncoding : string * int -> bool
Public Shared Function IsHexEncoding (pattern As String, index As Integer) As Boolean

매개 변수

pattern
String

확인할 문자열입니다.The string to check.

index
Int32

16진수 인코딩을 확인할 pattern의 위치입니다.The location in pattern to check for hexadecimal encoding.

반환

Boolean

pattern이 지정된 위치에 16진수로 인코딩되어 있으면 true이고, 그렇지 않으면 false입니다.true if pattern is hexadecimal encoded at the specified location; otherwise, false.

예제

다음 코드 예제에서는 문자가 16 진수로 인코딩 되었는지 여부를 확인 하 고, 그럴 경우 해당 문자를 콘솔에 씁니다.The following code example determines whether a character is hexadecimal encoded and, if so, writes the equivalent character to the 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");
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

설명

The <xref:System.Uri.IsHexEncoding%2A> method checks for hexadecimal encoding that follows the pattern "%hexhex" in a string, where "hex" is a digit from 0 to 9 or a letter from A-F (case-insensitive).

적용 대상