From: Sam Roberts Date: 2004-04-19T07:55:59+09:00 Subject: Re: How do I insert into an array? Quoteing vjoel@PATH.Berkeley.EDU, on Mon, Apr 19, 2004 at 06:36:56AM +0900: > Sam Roberts wrote: > >I want to add an item just before the end: > > Here's a way: > > irb(main):001:0> a = [1,2,3] > => [1, 2, 3] > irb(main):002:0> a[-1,0] = "second last" > => "second last" That's great, thanks. I never read past where it said that kind of call "replaced" things, because I don't want to replace things. It never occurred to me I could 'replace" zero things! Sam