From: Pit Capitain Date: 2002-03-28T20:50:39+09:00 Subject: Re: How to split an Array efficiently? + non-inplace Delete_if On 26 Mar 2002, at 22:06, YANAGAWA Kazuhisa posted a solution for the following task: > > a, b = [1,7,10,3,12].split do |x| > > x < 10 > > end > > > > # a = [1,7,3] > > # b = [10,12] using a hash called "univ" and then argued: > oops, order is not trivially > expectable. a and b may be reversed. Assuming the keys are sortable you could return univ.indexes( univ.keys.sort ) instead of univ.values Regards, Pit