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};
1a\nb
0ab
0ab
0anb

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