From: Michael Gaunnac Date: 2004-10-08T23:08:03+09:00 Subject: Re: A sort_by descending sort Gavin Kistner wrote: > 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 } > > ? Well, I was working with longer strings that I had to slice several keys from. I guess I simplified the context too much. Mike