From: Ross Bamford Date: 2005-12-22T06:37:48+09:00 Subject: Re: move to front of array On Wed, 21 Dec 2005 21:13:11 -0000, Ezra Zygmuntowicz wrote: > array.unshift(array.delete_at(array.index("Cool"))) > > # => ["Cool", "a", "B", "c", "d", "e", "f", "G"] > Nice :) I missed 'index'. It led me to this: ([ary[ary.index("Cool")]] + ary).uniq Then from there to ([*ary.grep(/Cool/)] + ary).uniq Obviously it's useless line-noise and doesn't perform well I expect, but I enjoy this game :) -- Ross Bamford - rosco@roscopeco.remove.co.uk