Course of Raku / Advanced / More about built-in types / Quoting constructs 🆕 / q, qq, and Q
Quiz — Quoting
What does the following program print?
say q{a\nb};| 1 | a\nb |
| 0 | a |
| 0 | ab |
| 0 | anb |
The q operator works like single quotes: it does not
process backslash escapes such as \n. So the string keeps
all four characters a, \, n,
b. Only an interpolating form like qq (or
double quotes) would turn \n into a real newline.
Course navigation
← q, qq, and Q | Quoting adverbs →