From: Todd Benson Date: 2009-04-28T05:38:12+09:00 Subject: Re: How to parse a "line"? On Sun, Apr 26, 2009 at 9:11 PM, Todd Benson wrote: > > If you look closely, you'll see that James' method grabs everything > from 1 to -1 (the end) of the array, omitting the zeroth element. > > Robert's method assigns the garbage -- in this case, the whole array > -- to a dummy variable, and the important stuff to the var that you > care about (items). > > My way was only slightly different. I opted to create the whole > array, and then drop the first without creating an extra object. I > had to use (items = my_item_list.split) inside parens like that > because #shift returns the object you popped off the front of the > list, and not the actual remaining stuff. > > In all examples given, the size doesn't really matter... hah! Or as > they say, it depends :-) > > There are probably several ways to do this; I just like that particular one. > > hth, > Todd > That looks like I'm buoying my idea. I think any single one of these methods will work just fine. I'm somewhat leaning towards [1..-1] because it's very clear what's happening. I'll stick with my #shift for now because it makes logical sense to me. I'm not overly concerned in my work with speed or memory use. James knows what he's talking about so really listen to him. Todd