From: James Gray Date: 2009-04-27T05:56:44+09:00 Subject: Re: How to parse a "line"? On Apr 26, 2009, at 3:48 PM, Martin Sharon wrote: > Hi there: > > I have a line, the format is like this > "num_of_item item1 item2...item_n" for example > > "3 Tokyo Newyork Paris" > > I want ruby parse this format, extract these keywords and save them in > an array. > I googled and search many forums, but can't find any matches. > > Would anyone give me any ideas?? If you just need to bust up the words via the spaces, this should probably work for you: >> items = "3 Tokyo Newyork Paris".split[1..-1] => ["Tokyo", "Newyork", "Paris"] James Edward Gray II