Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


For multiline strings, you can triple the quotes: ie. triple double quotes for GStrings and triple single quotes for mere Strings.

If you need to write regular expression patterns, you should use the "slashy" string notation:

Code Block
assert "foooo/baaaaar" ==~ /fo+\/ba+r/

The advantage of the "slashy" notation is that you don't need to double escape backslashes, making working with regex a bit simpler.

Last but not least, prefer using single quoted strings when you need string constants, and use double quoted strings when you are explicitly relying on string interpolation.

Native syntax for data structures