From: Marnen Laibow-Koser Date: 2009-11-19T06:45:40+09:00 Subject: Re: each_with_index Jane O'Maley wrote: > Hi, I'm trying to get my file to take in a list of names (a firstname, > surname and middlename) and to then list each part of the name with an > index. For example one name "John, Smith, Paul" should be printed as > 1.John > 2.Smith > 3.Paul > > I can list the index as 1.John Smith Paul but am unsure on how to list > each part of the name seperately, does anyone have any ideas? Create one array with all the strings in it. Or define Person#each or Person#to_a. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen@marnen.org -- Posted via http://www.ruby-forum.com/.