From: Harry Kakueki Date: 2009-06-08T19:59:37+09:00 Subject: Re: How to sort array ascending, except zero ? On Mon, Jun 8, 2009 at 5:40 PM, Paganoni wrote: > Hello, I need to sort > [1,4,2,0,8,9] to [1,2,4,8,9,0] > > A simple ascending sort but with the zero values to the end > > I really don't see how to do > > Thanks for your help > > tmp = arr.partition{|x| x != 0 } (tmp[0].sort + tmp[1]) Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/ruby/list.html