View source code
Display the source code in std/ascii.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Enum std.ascii.ControlChar

All control characters in the ASCII table (source).

enum ControlChar : char { ... }

Enum members

ack Acknowledge
bel Bell
bs Backspace
can Cancel
cr Carriage return
dc1 Device control 1
dc2 Device control 2
dc3 Device control 3
dc4 Device control 4
del Delete
dle Data link escape
em End of medium
enq Enquiry
eot End of transmission
esc Escape
etb End of transmission block
etx End of text
ff NP form feed, new page
fs File separator
gs Group separator
lf NL line feed, new line
nak Negative acknowledge
nul Null
rs Record separator
si Shift in
so Shift out
soh Start of heading
stx Start of text
sub Substitute
syn Synchronous idle
tab Horizontal tab
us Unit separator
vt Vertical tab


import std.algorithm.comparison, std.algorithm.searching, std.range, std.traits;

// Because all ASCII characters fit in char, so do these
static assert(ControlChar.ack.sizeof == 1);

// All control characters except del are in row starting from 0
static assert(EnumMembers!ControlChar.only.until(ControlChar.del).equal(iota(32)));

static assert(ControlChar.nul == '\0');
static assert(ControlChar.bel == '\a');
static assert(  == '\b');
static assert(ControlChar.ff  == '\f');
static assert(ControlChar.lf  == '\n');
static assert(  == '\r');
static assert( == '\t');
static assert(ControlChar.vt  == '\v');


import std.conv;
//Control character table can be used in place of hexcodes.
with (ControlChar) assert(text("Phobos", us, "Deimos", us, "Tango", rs) == "Phobos\x1FDeimos\x1FTango\x1E");


Walter Bright and Jonathan M Davis


Boost License 1.0.