ruby-1.9.2-p136 :009 > x = [2,3,4]
 => [2, 3, 4]
ruby-1.9.2-p136 :010 > x.unshift(5)
 => [5, 2, 3, 4]

On Tue, Jan 25, 2011 at 6:10 AM, Sam T. <samtreweek / googlemail.com> wrote:

> Hi, Does anyone know how to add a new value to the top of an array,
> instead of the bottom. eg. When using <<, this appends to the end.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>