isPrintable

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

Return Value

Type: bool

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

Examples

assert( isPrintable(' '));  // whitespace is printable
assert( isPrintable('1'));
assert( isPrintable('a'));
assert( isPrintable('#'));
assert(!isPrintable('\0')); // control characters are not printable

// N.B.: Printable non-ASCII Unicode characters are not recognized.
assert(!isPrintable('á'));

Meta