Ruby Quick Reference

Quick reference for efficient coding

View the Project on GitHub YumaYX/RubyQuickReference

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.5