isControl

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

Return Value

Type: bool

Whether c is a control character.

Examples

1 assert( isControl('\0'));
2 assert( isControl('\022'));
3 assert( isControl('\n')); // newline is both whitespace and control
4 assert(!isControl(' '));
5 assert(!isControl('1'));
6 assert(!isControl('a'));
7 assert(!isControl('#'));
8 
9 // N.B.: non-ASCII Unicode control characters are not recognized:
10 assert(!isControl('\u0080'));
11 assert(!isControl('\u2028'));
12 assert(!isControl('\u2029'));

Meta