返回顶部

收藏

each word reading

更多
# Create a file...
open('end_separated_records', 'w') do |f|
  f << %{This is record one.
It spans multiple lines.ENDThis is record two.END}
end

# And read it back in.
open('end_separated_records') { |f| f.each('END') { |record| p record } }
# 'This is record one.\nIt spans multiple lines.END'
# 'This is record two.END'

标签:Ruby,文件

收藏

0人收藏

支持

0

反对

0

发表评论