Uri.IsHexDigit(Char) 메서드

정의

지정된 문자가 유효한 16진수인지 여부를 확인합니다.

public:
 static bool IsHexDigit(char character);
public static bool IsHexDigit(char character);
static member IsHexDigit : char -> bool
Public Shared Function IsHexDigit (character As Char) As Boolean

매개 변수

character
Char

유효성을 검사할 문자입니다.

반품

true문자가 유효한 16진수이면 이고, 그렇지 않으면 . false

예제

다음 예제에서는 문자가 16진수 문자인지 여부를 확인하고, 문자인 경우 해당 10진수 값을 콘솔에 씁니다.

char  testChar = 'e';
if (Uri.IsHexDigit(testChar))
    Console.WriteLine("'{0}' is the hexadecimal representation of {1}", testChar, Uri.FromHex(testChar));
else
    Console.WriteLine("'{0}' is not a hexadecimal character", testChar);

string returnString = Uri.HexEscape(testChar);
Console.WriteLine("The hexadecimal value of '{0}' is {1}", testChar, returnString);
let testChar = 'e'
if Uri.IsHexDigit testChar then
    printfn $"'{testChar}' is the hexadecimal representation of {Uri.FromHex testChar}"
else
    printfn $"'{testChar}' is not a hexadecimal character"

let returnString = Uri.HexEscape testChar
printfn $"The hexadecimal value of '{testChar}' is {returnString}"
Dim testChar As Char = "e"c
If Uri.IsHexDigit(testChar) = True Then
    Console.WriteLine("'{0}' is the hexadecimal representation of {1}", testChar, Uri.FromHex(testChar))
Else
    Console.WriteLine("'{0}' is not a hexadecimal character", testChar)
End If 
Dim returnString As String = Uri.HexEscape(testChar)
Console.WriteLine("The hexadecimal value of '{0}' is {1}", testChar, returnString)

설명

16진수는 0에서 9까지의 숫자와 문자 A-F 또는 a-f입니다.

적용 대상