From: Dan Diebolt Date: 2005-12-22T06:39:20+09:00 Subject: Re: move to front of array --0-840281129-1135201148=:26597 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit >That certainly would work (assuming that only one element matches the condition), seems to work on multiple matches: array = %w(a B c d Cool e f G Cool Cooler) => ["a", "B", "c", "d", "Cool", "e", "f", "G", "Cool", "Cooler"] array = array.partition{ |el| el =~ /cool/i }.flatten! => ["Cool", "Cool", "Cooler", "a", "B", "c", "d", "e", "f", "G"] I was uncertain about needing parenthesis before applying flatten but it makes perfect sense: array = (array.partition{ |el| el =~ /cool/i }).flatten! __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-840281129-1135201148=:26597--