Skip to content

Instantly share code, notes, and snippets.

@sue445
Created March 17, 2016 07:29
Show Gist options
  • Save sue445/768d8e8bf6ec7bc05842 to your computer and use it in GitHub Desktop.
Save sue445/768d8e8bf6ec7bc05842 to your computer and use it in GitHub Desktop.
strip_heredoc vs <<~
require "active_support/core_ext/string/strip"
message1 = <<-EOS.strip_heredoc
aaaaa
bbbbb\nccccc
ddddd
EOS
puts message1
=begin
aaaaa
bbbbb
ccccc
ddddd
=end
message2 = <<~EOS
aaaaa
bbbbb\nccccc
ddddd
EOS
puts message2
=begin
aaaaa
bbbbb
ccccc
ddddd
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment