From: "Nicolas Desprès" Date: 2007-02-21T21:03:49+09:00 Subject: Re: get rid of last element in an array On Feb 20, 2:20 pm, Josselin wrote: > if i have > > my_list = "2-131-25-5558-247-68" > > and I want to get rid of the last element... If you want to keep your list as a string: my_list.sub(/-\d+$/, '') or if you want your list as an array: my_array = my_list.split(/-/) my_array.delete_at(-1) Cheers, Nico