From: 7stud -- Date: 2007-10-04T21:15:00+09:00 Subject: Re: opinion on a simple method Robert Klemme wrote: > > irb(main):001:0> "a b c".each(" ") {|w| p w} > "a " > " " > "b " > "c" > => "a b c" > > Note, it'll probably still work. > Nice catch! Actually, your solution suffers from the same probem. :( Adding this line corrects mine, and it doesn't slow it down much: IO.foreach("data.txt") do |line| line.each(" ") do |word| next if word == " " print word.capitalize end end -- Posted via http://www.ruby-forum.com/.