isDigit

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

Return Value

Type: bool

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

Examples

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

Meta