From: Brian Adkins Date: 2009-02-25T14:14:18+09:00 Subject: Re: array Ashikali Ashikali writes: > Vetrivel Vetrivel wrote: >> >> >> How to Join multiple arrays in a single method in ruby >> Ex: >> a= [ 1 ,2 , 3] >> b = [4,5,6] >> c = [7,8,9] >> Using single method i want b and c array content into the a array. > > Hey , what is this ? are you read documentation for ruby or any thing > else ?. > > Answer is , > a + b + c I expect that was what the OP was looking for. But on the other hand, your solution involves two methods, not one. One way to do it with one method is the following: require 'pp' class Array def concat_multi! *lists lists.each {|list| self.concat(list) } end end a = [1, 2, 3] b = [4, 5, 6] c = [7, 8, 9] d = [10, 11] a.concat_multi!(b, c, d) pp a -- Brian Adkins http://lojic.com/