Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
Escape characters are special characters that are used to represent certain actions or non-printable characters within a string. They are preceded by a backslash (\) and allow you to include characters like quotes, newlines, or tabs in your strings.
Related terms
String literals: A sequence of characters enclosed in double quotes ("") or single quotes ('').
Backslash (\): An escape character used to indicate the start of an escape sequence.
Newline character (\n): An escape sequence that represents a line break in a string.