Uri.IsHexDigit(Char) Yöntem

Tanım

Belirtilen karakterin geçerli bir onaltılık basamak olup olmadığını belirler.

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

Parametreler

character
Char

Doğrulanması gereken karakter.

Döndürülenler

Boolean

true karakter geçerli bir onaltılık basamak ise; aksi takdirde , false.

Örnekler

Aşağıdaki örnek, bir karakterin onaltılık karakter olup olmadığını belirler ve karakter ise konsola karşılık gelen ondalık değeri yazar.

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);
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)

Açıklamalar

Onaltılık basamaklar 0 ile 9 arasında basamaklar ve A-F veya a-f harfleridir.

Şunlara uygulanır