isPrintable

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

Return Value

Type: bool

Whether or not c is a printable character - including the space character.

Examples

1 assert( isPrintable(' '));  // whitespace is printable
2 assert( isPrintable('1'));
3 assert( isPrintable('a'));
4 assert( isPrintable('#'));
5 assert(!isPrintable('\0')); // control characters are not printable
6 
7 // N.B.: Printable non-ASCII Unicode characters are not recognized.
8 assert(!isPrintable('á'));

Meta