From: Bertram Scharpf Date: 2009-09-07T11:33:13+09:00 Subject: Re: i need to strip \n and nil Hi, Am Montag, 07. Sep 2009, 08:41:45 +0900 schrieb 7stud --: > Michael Fellinger wrote: > > > > ["59023\n", nil].join.to_i > > You're kidding, right? I don't beleive it either but it's time to say: ary.compact.map { |l| l.chomp }.join This is expert level (and maybe even not portable): ary.compact! ary.each { |l| l.chomp! } result = ary.join I'm quite sure that the result is always in the first array element. res = ary.first res.chomp! Everything untested. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de