DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Interleave 3 Arrays

06.10.2010
| 3776 views |
  • submit to reddit
        
abc = %w(a1 a2 a3).zip %w(b1 b2 b3), %w(c1 c2 c3)
#=> [["a1", "b1", "c1"], ["a2", "b2", "c2"], ["a3", "b3", "c3"]]
Resources:
 - <a href="http://snippets.dzone.com/posts/show/7710">Interleave 3 or more arrays</a> [dzone.com]