DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR RUBY
ruby array split into groups
a = [1, 2, 3, 4, 5, 6] a.each_slice(3).to_a # => [[1, 2, 3], [4, 5, 6]]
PREVIOUS
NEXT
Tagged:
#ruby
#array
#split
#groups
ADD COMMENT
Topic
COMMENT
Name
6+7 =
Submit