如何在代码中为ruby添加一行

时间:2016-03-05 13:29:44

标签: ruby

我道歉我相信答案已经存在,但我根本无法清楚地表达谷歌搜索...

给出了很长的代码

puts 'This is a really long line of ruby code here'

如何将它分成2行,即

puts 'This is a really long
      line of ruby code here'

1 个答案:

答案 0 :(得分:1)

str = 'first line'\
  ' second line'\
  ' third line'

puts str