From: Gavin Kistner Date: 2004-10-08T23:01:07+09:00 Subject: Re: A sort_by descending sort On Oct 8, 2004, at 7:57 AM, Michael Gaunnac wrote: > arr = arr.sort_by {|i| [i.slice(0,2).tr('0-9','9876543210')]} # > descending sort using 9's complement Tricky, but how about just: arr = arr.sort_by{ |n| -n.to_i } ? -- "When I am working on a problem I never think about beauty. I only think about how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." - R. Buckminster Fuller