From: Robert Klemme Date: 2004-09-03T02:20:19+09:00 Subject: Re: autochomp? "Martin DeMello" schrieb im Newsbeitrag news:idIZc.301315$J06.4478@pd7tw2no... > Any way to make IO.readlines chomp each line before adding it to the > array? (i.e. a = IO.readlines.map {|i| i.chomp} but done in the > readlines call itself) Not AFAIK. You can do content = IO.readlines(file).each {|l| l.chomp!} or (more efficient) content = File.open(file) {|io| io.inject([]) {|ar,line| line.chomp!; ar << line} } But I guess you figured that yourself already. Kind regards robert