From: Dipti Iyengar Date: 2009-07-09T20:05:24+09:00 Subject: Re: Help required on sorting David A. Black wrote: > Hi -- > > On Thu, 9 Jul 2009, Dipti Iyengar wrote: > >> Any quicker way to do this? > You could do: > > LEVELS = %w{ High Medium Low Info Safe } > > sorted = risks.sort_by {|r| LEVELS.index(r.capitalize) } > > > David Thanks a lot Bertram .... Worked like a charm.... Thanks a lot David...didn't try the solution as yet :) -- Posted via http://www.ruby-forum.com/.