public Method

Array.reverse!

array.reverse!    array

Reverses self in place.

a = [ "a", "b", "c" ]
a.reverse!       #=> ["c", "b", "a"]
a                #=> ["c", "b", "a"]

Source Code

/*
*  call-seq:
*     array.reverse!   -> array 
*  
*  Reverses _self_ in place.
*     
*     a = [ "a", "b", "c" ]
*     a.reverse!       #=> ["c", "b", "a"]
*     a                #=> ["c", "b", "a"]
*/

static VALUE
rb_ary_reverse_bang(ary)
   VALUE ary;
{
   return rb_ary_reverse(ary);
}
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.