From: James Edward Gray II Date: 2007-02-20T22:30:05+09:00 Subject: Re: get rid of last element in an array On Feb 20, 2007, at 7:20 AM, Josselin wrote: > > if i have > > my_list = "2-131-25-5558-247-68" > > and I want to get rid of the last element... I would use a regular expression: >> my_list = "2-131-25-5558-247-68" => "2-131-25-5558-247-68" >> my_list.sub(/-\d+\Z/, "") => "2-131-25-5558-247" Hope that helps. James Edward Gray II