ruby中的puts
语句会自动添加新行,如何避免?
发布于 2012-01-04 14:54:22
请改用print
。你可能想在STDOUT.flush
上跟进一下。
发布于 2013-05-17 11:21:50
此外,您还需要在行尾附加"\r“以表示”回车“,并在当前行的开头执行下一步打印
发布于 2015-11-10 21:23:24
$stdout.sync = true
100.times do
print "."
sleep 1
end
"How can I use “puts” to the console without a line break in ruby on rails?"
https://stackoverflow.com/questions/8723120
复制相似问题