multiline strings

Multi-line strings

A multi-line literal string starts and ends with triple quotes:

“”” multiple line

Strings are

allowed “”” println;

A special multi-line literal string starts with |”””, with the | character before the quotes. Both | and all characters before it in the current line are eliminated. Every | should be in a different line, although there may be empty lines between two lines. All | characters should be in the same column. All white spaces before the closing “”” are removed. The result is a multi-line string in which | delimited the start of each line.

var String s;
s = |"""
|today
|is the
|day to be happy
""";

Of course, variable interpolation with $ works with multi-line literal strings.