From: Timothy Hunter Date: 2006-06-07T06:22:40+09:00 Subject: Re: Slicing arrays Paul D. Kraus wrote: > if have a text file I am parsing. I am using split to break the line > into an > array. > I want to then use splice to pick and choose the fields that I one. > > so for example i have a string. > mystring = '1,2,3,4,5,6' > > then i want to get an array but I only want the 2 field and the last > three > fields. > myarray = mystring.split(',').splice(1,3..5) > > This breaks. > > I can get the range 3..5 or i get the element splice(1). > > Am I missing something? > > Do i just build the array as normal and then make a new array from the > elements I need? > > Paul > Have you tried the values_at method?