From: Bertram Scharpf Date: 2007-08-18T04:30:05+09:00 Subject: Re: removing something from the end of each item in an array Hi, Am Samstag, 18. Aug 2007, 03:35:11 +0900 schrieb Chris Carter: > On 8/17/07, Simon Schuster wrote: > > ["blah\n", "la\n", "hooray\n"] > > > > array.map {|x| x.chomp } will strip whitespace including new-lines. Here, this just strips the newlines. Depending on what Simon meant there's also array.map! {|x| x.chop } array.map! {|x| x.rstrip } array.map! {|x| x.strip } I often even say array.each { |x| x.strip! } but that belongs into the poison chest and is for people who know what they're doing. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de