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

## Definição

Determina se um caractere especificado é um 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 Char Char Char

O caractere a ser validado.The character to validate.

#### Retornos

`true` se o caractere for um dígito hexadecimal válido, caso contrário, `false`.`true` if the character is a valid hexadecimal digit; otherwise, `false`.

## Exemplos

O exemplo a seguir determina se um caractere é um caractere hexadecimal e, se for, grava o valor decimal correspondente no console.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)
``````

## Comentários

Os dígitos hexadecimais são os dígitos de 0 a 9 e as letras A-F ou a-f.Hexadecimal digits are the digits 0 to 9 and the letters A-F or a-f.