The development, refinement, and deployment of SE-0200 Enhancing String Literals Delimiters to Support Raw Text was a long and surprising journey. It ended with a uniquely Swift take on “raw strings” that focused on adding custom delimiters to string literals and escape sequences.
This post discusses what raw strings are, how Swift designed its take on this technology, and how you can use this new Swift 5 feature in your code.
Table of Contents
Escape Sequences
Escape sequences are backslash-prepended combinations like \
, "
, and u{n}
that incorporate characters that would otherwise be hard to express inside a normal string literal. Swift escape sequences include:
- The special characters