We help IT Professionals succeed at work.

array.each_slice

philsivyer
philsivyer asked
on
540 Views
Last Modified: 2012-05-08
Hello
Just trying to use an array method in a chunk of my code and keep getting error message
undefined method `each_slice'
What's the problem with this..
array=[1,2,3,4,5,6,7]
array.each_slice(3) {|slice| p slice}
Regards
Phil
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.