String litterals (Ruby)
Heredocs are cool & useful - C++,D,Ruby,Python
String literal without need to escape backslash
squiggly heredoc (ruby 2.3)
squiggly heredoc remove indentation from the actual string.
Heredoc on next line
Alternate Syntax
As with most other literals, Ruby provides an alternate syntax for string literals. If you’re using a lot of quote characters inside your literals, for example, you may want to use this syntax. When you use this syntax is a matter of style, they’re usually not needed for strings.
Use the following sequence for single-quoted strings %q{ … }. Similarly, use the following syntax for double-quoted strings %Q{ … }.
You can use any characters you with instead of braces. If you use a brace, square bracket, angle bracket or parenthesis, then the matching character will end the literal. If you don’t want to use matching characters, you can use any other symbol (anything not a letter or number). The literal will be closed with another of the same symbol.
The alternate syntax also works as a multi-line string.
- No variable expension, no need to escape single quote