Uri.IsHexDigit(Char) Uri.IsHexDigit(Char) Uri.IsHexDigit(Char) Uri.IsHexDigit(Char) Method

定義

指定した文字が有効な 16 進数の数字かどうかを判断します。Determines whether a specified character is a valid hexadecimal digit.

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 Char Char Char

検証対象の文字。The character to validate.

戻り値

文字が有効な 16 進数の値である場合は true。それ以外の場合は falsetrue if the character is a valid hexadecimal digit; otherwise, false.

次の例では、かどうか、文字が 16 進数の文字がの場合は、対応する 10 進値をコンソールに出力を決定します。The following example determines whether a character is a hexadecimal character and, if it is, writes the corresponding decimal value to the console.

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

String^ returnString = Uri::HexEscape( testChar );
Console::WriteLine( "The hexadecimal value of '{0}' is {1}", testChar, returnString );
char  testChar = 'e';
if (Uri.IsHexDigit(testChar) == true)
    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);
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 の文字です。Hexadecimal digits are the digits 0 to 9 and the letters A-F or a-f.

適用対象