# Uri.FromHex(Char)Uri.FromHex(Char)Uri.FromHex(Char)Uri.FromHex(Char) Method

## 定義

16 進数の数字に対応する 10 進数値を取得します。Gets the decimal value of a hexadecimal digit.

``````public:
static int FromHex(char digit);``````
``public static int FromHex (char digit);``
``static member FromHex : char -> int``
``Public Shared Function FromHex (digit As Char) As Integer``

#### パラメーター

digit
Char Char Char Char

#### 例外

`digit` が有効な 16 進数の数字 (0 ～ 9、a ～ f、A ～ F) ではありません。`digit` is not a valid hexadecimal digit (0-9, a-f, A-F).

## 例

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

## 注釈

メソッドFromHexは、16進数の数字 (0-9、a ~ f、a ~ f) を表す文字を10進数値 (0 ~ 15) に変換します。The FromHex method converts a character representing a hexadecimal digit (0-9, a-f, A-F) to its decimal value (0 to 15). `digit`有効な16進数の数字でないArgumentException場合は、例外がスローされます。If `digit` is not a valid hexadecimal digit, an ArgumentException exception is thrown.