From: Joshua Ball Date: 2008-12-18T13:40:51+09:00 Subject: Re: Array problem ------=_Part_31862_23977335.1229575722006 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I think this should do it: array.delete_if { |elem| not elem =~ /.bmp/i } It worked for the following test: array = [ "manyThings.mp3", "myLike.gif", "moreCoco.BmP", "theFormat.bmp"] array.delete_if { |elem| not elem =~ /.bmp/i } array.each do |elem| puts elem end On Wed, Dec 17, 2008 at 8:22 PM, John Zoldiark wrote: > I have an array like this: > array = [ "manyThings.mp3", "myLike.gif", "moreCoco.bmp", > "theFormat.bmp"] > > and I want to make some comparison to eliminate all the words in the > array that are NOT of the bmp format. So at the end the array will look > like this: > > array = ["moreCoco.bmp", "theFormat.bmp"] > > is there a way to do this??? > > Many thanks for the help > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_31862_23977335.1229575722006--