From: "Sebastian W." Date: 2008-12-18T13:39:15+09:00 Subject: Re: Array problem 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 Hi John, Yep, try this: array.reject! {|elem| elem.split(".").last != "bmp"} Cheers, Sebastian -- Posted via http://www.ruby-forum.com/.