Skip to the content.

plain_text.rb(heredoc)

If you are using Ruby version 2.3.0 or any later version, you can use this syntax without any issues. If you are using an earlier version, you might encounter a syntax error.

Execution:

doc = <<~'EOL'
  string
EOL
#=> "string\n"

Executed with Ruby 3.3.6