public Method

Array.concat(p1)

array.concat(other_array)     array

Appends the elements in other_array to self.

[ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]

Source Code

/* 
*  call-seq:
*     array.concat(other_array)   ->  array
*
*  Appends the elements in other_array to _self_.
*  
*     [ "a", "b" ].concat( ["c", "d"] ) #=> [ "a", "b", "c", "d" ]
*/


VALUE
rb_ary_concat(x, y)
   VALUE x, y;
{
   y = to_ary(y);
   if (RARRAY(y)->len > 0) {
       rb_ary_splice(x, RARRAY(x)->len, 0, y);
   }
   return x;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.