isDigit

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

Return Value

Type: bool

Whether c is a digit (0 .. 9).

Examples

assert( isDigit('3'));
assert( isDigit('8'));
assert(!isDigit('B'));
assert(!isDigit('#'));

// N.B.: does not return true for non-ASCII Unicode numbers
assert(!isDigit('0')); // full-width digit zero (U+FF10)
assert(!isDigit('4')); // full-width digit four (U+FF14)

Meta