numFromHex

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

@safe pure
numFromHex
(
const string hex
,
const bool acceptLowercase = true
)

Parameters

hex string

Hexadecimal number in string form.

acceptLowercase bool

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");