On Tue, Jan 25, 2011 at 12:10 PM, 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/.
>
>
a = [ "b", "c", "d" ]

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

-- 
Jens-Harald Johansen
--
There are 10 kinds of people in the world: Those who understand binary and
those who don't...