From: Shiwei Zhang Date: 2007-01-08T16:00:19+09:00 Subject: Re: Grouping elements of an array? FYI. B is what you expect: A=[1,2,3,4,5,6,7,8,9];B=[]; 3.times {B<Hello, > >What's the best way to do the following? > >[1,2,3,4,5,6,7,8,9] => [[1,2,3],[4,5,6],[7,8,9]] > >I want to transform the array into an array of arrays with fixed number >of elements. >I think there should be a method but I can't find it. > >I can iterate the elements using a counter to divide but it's so >boring. > >Thanks in advance. > >Sam > > > >