From: Robert Klemme Date: 2007-10-04T21:26:35+09:00 Subject: Re: opinion on a simple method 2007/10/4, 7stud -- : > 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. :( I don't think so. Please look again! > 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 But it changes white spaces - which my solution does not do. Kind regards robert