Uri.IsHexDigit(Char) Método

Definición

Determina si un carácter especificado es un dígito hexadecimal válido.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

Parámetros

character
Char

Carácter que se va a validar.The character to validate.

Devoluciones

Boolean

true si el carácter es un dígito hexadecimal válido; en caso contrario, false.true if the character is a valid hexadecimal digit; otherwise, false.

Ejemplos

En el ejemplo siguiente se determina si un carácter es un carácter hexadecimal y, si es así, se escribe el valor decimal correspondiente en la consola.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)

Comentarios

Los dígitos hexadecimales son los dígitos del 0 al 9 y las letras a-F o a-f.Hexadecimal digits are the digits 0 to 9 and the letters A-F or a-f.

Se aplica a