编辑代码

text = "1
2"

puts text.split("\n").map{|line| line.strip}.join(",")