Course of Raku / Advanced / More about built-in types / Quoting constructs 🆕 / Exercises / A raw string

Solution: A raw string

Here is a possible solution to the task.

Code

say Q{$x and \n};

🦋 You can find the source code in the file raw-string.raku.

Output

$x and \n

Comments

  1. Q is the most literal quoting form: it interpolates nothing and processes no escapes.

  2. So $x stays as text and \n stays as a backslash and an n.

Course navigation

A raw string   |   A closure in a q string