Trying to format mutliline string in Ruby
heredocand %q{ }there is a problem that they include spaces used to format the code.
s = %q{Foo
Bar
Baz}
puts s
Incorrectly produces the following:
Foo
Bar
Baz
The following works, but a little ugly with characters \.
s = "Foo\n" \
" Bar\n" \
" Baz"
puts s
The following works in python:
s = ("Foo\n"
" Bar\n"
" Baz")
print s
Is there an equivalent in Ruby?
Swiss source
share