From: Jan Date: 2011-11-02T12:28:21+09:00 Subject: Re: Sort order dilemma --0016e649d89e30be6304b0b81073 Content-Type: text/plain; charset=ISO-8859-1 array.sort_by {|s| [s.size, s]} On Wed, Nov 2, 2011 at 11:21 AM, Wayne Brissette wrote: > I've got a array that I need sorted in a certain way and I'm struggling to > figure out how to make it happen the way I want. > > Basically the array needs to be sorted like this: > > [A, B, C, AA, AB, AF ] > > that is, a single alpha character before it sorts the next character. > However, what I end up with when I sort is: > > [A, AA, AB, AF, B, C] > > How would I sort A to Z then AA-ZZ? > > Wayne > > > --0016e649d89e30be6304b0b81073--