From: William James Date: 2007-08-18T04:15:04+09:00 Subject: Re: removing something from the end of each item in an array On Aug 17, 1:30 pm, "Simon Schuster" wrote: > in this case a "\n"... > > ["blah\n", "la\n", "hooray\n"] > > array.collect { |x| x - "\n" } doesn't work, and I can't manage to > find any methods which might do the trick.. pretty basic, but I'm > still a beginner! thanks. If you want to remove all leading and trailing whitespace: array.map{|x| x.strip }