From: Derek Teixeira Date: 2007-02-20T22:33:57+09:00 Subject: Re: get rid of last element in an array Josselin wrote: > if i have > > my_list = "2-131-25-5558-247-68" > > and I want to get rid of the last element... > I wrote : > > my_list.split('-') - my_list.split('-').last.to_a => > "22-13-25-58-47" > > which runs well.. but isn't too complex.... ? > > tfyl > > joss i'm a newb, and i am probably totally wrong, but the only way to learn is to test what you think ... won't the .pop method work? or does that only get rid of the last thing entered? -- Posted via http://www.ruby-forum.com/.