Uri.IsHexEncoding(String, Int32) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
문자열의 문자가 16진수로 인코딩되었는지 여부를 확인합니다.
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
확인할 문자열입니다.
- index
- Int32
16진수 인코딩을 확인할 pattern의 위치입니다.
반환
pattern이 지정된 위치에 16진수로 인코딩되어 있으면 true이고, 그렇지 않으면 false입니다.
예제
다음 코드 예제에서는 문자가 16진수로 인코딩되는지 여부를 확인하고, 인코딩된 경우 해당 문자를 콘솔에 씁니다.
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
설명
이 메서드는 IsHexEncoding 문자열의 "%hexhex" 패턴을 따르는 16진수 인코딩을 확인합니다. 여기서 "16진수"는 0에서 9까지의 숫자이거나 A-F의 문자(대/소문자를 구분하지 않습니다)입니다.