liveBook · Manning

Escape sequence

An escape sequence is source notation, typically using an escape marker, that represents a character or control value or changes how characters are interpreted.

How 6 Manning books explain it

Modern C

An escape sequence is a C source notation beginning with a backslash that encodes a character or special value.

How it is used
Uses escapes to control `printf` output and specify Unicode characters in C string literals.
How deep it goes
Explains two output escapes and the four- and eight-digit Unicode forms, but does not develop a general escape catalogue.
Examples
Shows `\t` and `\n` in formatted output, `"\u00E4"`, and macros for graphical characters.
What you can do after
Apply it to write tabs, newlines, and specified Unicode characters in C literals.

Read how Modern C explains escape sequence →

Modern C, Third Edition

An escape sequence is source-code notation beginning with a backslash that encodes a character or special value.

How it is used
Supplies special output characters in printf formats and specifies Unicode code points in C multibyte string literals.
How deep it goes
Works through tab, newline, and four-digit Unicode notation, then notes eight-digit notation; does not enumerate all C escapes.
Examples
Uses a printf call containing `\t` and `\n`, `"\u00E4"`, and macros for Unicode box-drawing characters.
What you can do after
Apply it via printf and C string literals to control output layout and spell selected Unicode characters in source.

Read how Modern C, Third Edition explains escape sequence →

The Well-Grounded Rubyist, Fourth Edition

Character escaping is syntax that represents special characters or prevents characters from being interpreted as delimiters or interpolation markers.

How it is used
Controls literal characters and syntax interpretation in Ruby strings and regular expressions.
How deep it goes
Works through quoting, heredocs, regexp metacharacters, and dynamically constructed patterns, including the two parsing layers of Regexp.new.
Examples
Contrasts newline and tab output across quotation styles, then tests whether an interpolated dot matches a literal dot or any character.
What you can do after
Apply it via Regexp.escape to match interpolated text literally, and write string escapes that survive passage to Regexp.new.

Read how The Well-Grounded Rubyist, Fourth Edition explains escape sequence →

100 Java Mistakes and How to Avoid Them

An escape sequence is a backslash-initiated notation in a string or character literal that represents a special character or character value.

How it is used
Prevents malformed Java literals and regex patterns caused by treating backslashes as ordinary characters.
How deep it goes
Explains common escapes, silent literal changes, regex double interpretation, and path-based prevention.
Examples
Uses Windows paths, regex word boundaries, IDE highlighting, and Path.of as concrete examples.
What you can do after
Diagnose silently altered literals and construct paths or regex patterns with the required escaping.

Read how 100 Java Mistakes and How to Avoid Them explains escape sequence →

Learn Rust in a Month of Lunches

An escape sequence is a character sequence in a string literal that represents a special character or encoding instruction.

How it is used
Uses escape sequences to control printed line breaks, tabs, quotation marks, backslashes, and Unicode characters.
How deep it goes
Explains common escapes, Unicode notation, raw-string alternatives, and delimiter adjustments, while stopping short of broader string formatting.
Examples
Shows newlines, tabs, escaped quotes, file paths, raw strings, hashtags, byte strings, and Unicode escapes.
What you can do after
Apply it via Rust string literals to represent special characters and choose raw strings when escaping becomes cumbersome.

Read how Learn Rust in a Month of Lunches explains escape sequence →

The Quick Python Book, Fourth Edition

An escape sequence is a character sequence in a string literal that represents a character or control function using a backslash-based notation.

How it is used
Represents special characters and control functions inside Python string literals.
How deep it goes
Defines basic, numeric, and Unicode forms, then explains regex double interpretation; it defers broader Unicode-system details.
Examples
Uses newlines, tabs, quotes, backslashes, ASCII codes, Unicode names, and regex patterns as concrete examples.
What you can do after
Apply escape sequences to write strings containing control characters, quotes, backslashes, ASCII characters, and Unicode characters.

Read how The Quick Python Book, Fourth Edition explains escape sequence →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.