isHexDigit

bool
isHexDigit
@safe pure nothrow @nogc
(
dchar c
)

Return Value

Type: bool

Whether c is a digit in base 16 (0 .. 9, A .. F, a .. f).

Examples

1 assert( isHexDigit('0'));
2 assert( isHexDigit('A'));
3 assert( isHexDigit('f')); // lowercase hex digits are accepted
4 assert(!isHexDigit('g'));
5 assert(!isHexDigit('G'));
6 assert(!isHexDigit('#'));

Meta