From: Robert Klemme Date: 2007-10-04T20:18:08+09:00 Subject: Re: opinion on a simple method 2007/10/4, 7stud -- : > 7stud -- wrote: > > > > File.open("data.txt") do |file| > > file.each() do |line| > > line.each(" ") do |word| > > print word.capitalize > > end > > end > > end > > > > Ahh. And stealing from Alex and Robert: > > IO.foreach("data.txt") do |line| > line.each(" ") do |word| > print word.capitalize > end > end Nice idea but: irb(main):001:0> "a b c".each(" ") {|w| p w} "a " " " "b " "c" => "a b c" Note, it'll probably still work. Kind regards robert