The OpenD Programming Language

isControl

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

Return Value

Type: bool

Whether c is a control character.

Examples

assert( isControl('\0'));
assert( isControl('\022'));
assert( isControl('\n')); // newline is both whitespace and control
assert(!isControl(' '));
assert(!isControl('1'));
assert(!isControl('a'));
assert(!isControl('#'));

// N.B.: non-ASCII Unicode control characters are not recognized:
assert(!isControl('\u0080'));
assert(!isControl('\u2028'));
assert(!isControl('\u2029'));

Meta