deleting blank lines after loop

后端 未结 3 651
滥情空心
滥情空心 2021-01-25 19:51

ok, I have the following, very simple code:

f = \"String1\\n\\n\\nString2\\n\\n\\n\"
f.each_line do |t|
  t.delete! \"\\n\"
  puts t.inspect
end
<
3条回答
提交回复
热议问题