This documentation is archived and is not being maintained.

Uri.FromHex Method

Returns the decimal value of a hexadecimal digit.

[Visual Basic]
Public Shared Function FromHex( _
   ByVal digit As Char _
) As Integer
public static int FromHex(
 char digit
public: static int FromHex(
 __wchar_t digit
public static function FromHex(
   digit : Char
) : int;


The hexadecimal digit (0-9, a-f, A-F) to convert.

Return Value

A number from 1 - 15 that corresponds to the specified hexadecimal digit.


Exception Type Condition
ArgumentException digit is not a valid hexadecimal digit (0-9, a-f, A-F).


The FromHex method converts a character representing a hexadecimal digit (0-9, a-f, A-F) to its decimal value (0-15). If digit is not a valid hexadecimal digit, ArgumentException is thrown.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

Uri Class | Uri Members | System Namespace