From: Intransition Date: 2011-09-07T07:47:06+09:00 Subject: Grouping an array into sub-arrays. Is there a method out there already that does anything like this? [0,1,2,3,4].group(0..-2, -1) #=> [[0,1,2,3]. [4]] [0,1,2,3,4].group(0, 2..3, 4..-1) #=> [[0], [2,3], [4]]