红宝石
str = "this is \n multi-line \n text \n\n"
puts str
# this is
# multi-line
# text
使用gsub!修改字符串
str.gsub!("\n","")
puts str # this is multi-line text
滑轨
使用squish删除所有不必要的空格
str = "this is \nmulti-line \n text \n\n"
puts str.squish # this is multi-line text