From: Joda jenson Date: 2011-09-30T06:20:41+09:00 Subject: Re: IO.readlines will not accept variable with file name Why? Peter Vandenabeele wrote in post #1024266: > On Thu, Sep 29, 2011 at 10:39 PM, Joda jenson > wrote: > >> >> >> > puts filearray [0] >> Thanks for the help on this sorry for the typo, it was really late when >> I >> was posting. >> >> What is the easiest why to get the "\n" off the end? >> > > Look at chomp > > peterv@ASUS:~$ irb > 001:0> a = gets > test > => "test\n" > 002:0> a.chomp > => "test" > 003:0> > > HTH, > > Peter Peter is there any difference between chomp and This: string = string.gsub(/\n/," ") chomp looks easier to remember. THanks both fixed the issue. Thanks peter, roger and all fixed a headache for me. -- Posted via http://www.ruby-forum.com/.