A   here document   (or "heredoc")   is a way of specifying a text block, preserving the line breaks, indentation and other whitespace within the text.

Depending on the language being used, a   here document   is constructed using a command followed by "<<" (or some other symbol) followed by a token string.

The text block will then start on the next line, and will be followed by the chosen token at the beginning of the following line, which is used to mark the end of the text block.



Task

Demonstrate the use of   here documents   within the language.

Related task

   Documentation


import std.stdio, std.string;
 
void main() {
    // Delimited strings: a 'q' followed by double quotes and an
    // opening and closing delimiter of choice:
 
    q"[a string that you "don't" have to escape]"
    .writeln;
 
    // If the delimiter is an identifier, the identifier must be
    // immediately followed by a newline, and the matching delimiter
    // is the same identifier starting at the beginning of the line:
 
    q"EOS
    This
    is a multi-line
    heredoc string
EOS".outdent.writeln;
 
    // std.string.outdent is used to remove the four spaces indent.
}