2012-04-03から1日間の記事一覧
lines = "" File.open(file_name) do |f| i = 0 while l = f.gets lines += l.strip lines += "\n" if i%3==2 i += 1 end end もっとRubyっぽい書き方はできないものだろうか..
lines = "" File.open(file_name) do |f| i = 0 while l = f.gets lines += l.strip lines += "\n" if i%3==2 i += 1 end end もっとRubyっぽい書き方はできないものだろうか..