System.Uri.FromHex Method

Gets the decimal value of a hexadecimal digit.

Syntax

public static int FromHex (char digit)

Parameters

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

Returns

An int value that contains a number from 0 to 15 that corresponds to the specified hexadecimal digit.

Exceptions

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

Remarks

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

Requirements

Namespace: System
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0