From: Dick Davies Date: 2005-09-29T22:20:05+09:00 Subject: Re: slurp a file into an array without newlines Lovely, thanks. On 29/09/05, Kroeger Simon (ext) wrote: > > > > -----Original Message----- > > From: Dick Davies [mailto:rasputnik@gmail.com] > > Sent: Thursday, September 29, 2005 11:35 AM > > To: ruby-talk ML > > Subject: slurp a file into an array without newlines > > > > Coffee....not.....working....... > > > > what's a neater way of doing this? > > > > lines = File.new('sometextfile').readlines.map { |l| l.chomp } > > > > -- > > Rasputin :: Jack of All Trades - Master of Nuns > > lines = IO.read('test.rb').split("\n") > > cheers > > Simon > > -- Rasputin :: Jack of All Trades - Master of Nuns