In article <1a701a2f74c6f4245c0092667a764972 / ruby-forum.com>,
Dominic Son  <dominicson / gmail.com> wrote:
>Hello.
>
>Each of my arrays look like this:
>container[0] = ["foo", "bar", "baz"]
>container[1] = ["doo", "poo", "woo"]
>
>i'd like to sort by  the second position (bar, and poo)
>and of course,affecting the whole row, so that "bar" should be on top, 
>along with "foo" and "baz" as container[0].
>
>What method should i use?

container.sort { |x,y| x[1]<=>y[1] }
-- 
Mark Ping                     
emarkp / soda.CSUA.Berkeley.EDU