From: Ne Scripter Date: 2009-10-01T22:15:16+09:00 Subject: Re: Group by unique entries of a hash I am having real problems with my array. As expected my array contents is like so: "00000004 00000005" "00000003 00000006" "00000001" "00000002" I now want 6 indivdual elements insteal of 4. I have tried to split the double entries up with split, however they remain together. Is there something fundamental I am missing? I want an array like so array = ["00000004", "00000005", "00000003", "00000006", "00000001", "00000002"] Sorry if this is simple, I have spent several hours chopping and changing. Thanks S David A. Black wrote: > On Thu, 1 Oct 2009, Simon Krahnke wrote: > >> or >> >> hash, ocrID, *ignored = *data.split(",") >> >> if you want to ignore everything behind a second comma, or >> >> hash, ocrID = *data.split(",", 2) >> >> if you want to include a second comma and everything behind it into the >> ocrID string. > > I don't think you need the * for any of them. This: > > hash, ocrID = data.split(',') > > should be fine for getting the first two values. > > > David -- Posted via http://www.ruby-forum.com/.