numFromHex

Returns the decimal value of a hex number in string form.

@safe pure
numFromHex
(
const string hex
,
const Flag!"acceptLowercase" acceptLowercase = Yes.acceptLowercase
)

Parameters

hex string

Hexadecimal number in string form.

acceptLowercase Flag!"acceptLowercase"

Flag of whether or not to accept rrggbb in lowercase form.

Return Value

Type: auto

An integer equalling the value of the passed hexadecimal string.

Throws

ConvException if the hex string was malformed.

Examples

int fifteen = numFromHex("F");
int twofiftyfive = numFromHex("FF");

Meta