Hi, I recently came to ruby after spending a few months learning Python. I was wondering if there is a way similar to Python's triple quote ' """ ' that allows for a comment to be printed on multi-lines say for instance: puts "The choice is yours kid: A) Shake down the owner B) Rob the storekeeper" You wanted this to print exactly in the format as you see here... how would you do this?
on 2014-05-09 21:00
on 2014-05-09 22:09
The code you wrote is actually valid ruby, although you'll need to offset a bit because of "puts". irb(main):001:0> puts "The choice is yours kid: A) Shake down the owner irb(main):002:0" B) Rob the storekeeper" The choice is yours kid: A) Shake down the owner B) Rob the storekeeper If you're writing complex multiline strings, you might want to have a look at Heredocs: http://rubyquicktips.com/post/4438542511/heredoc-and-indent