From: Todd Benson Date: 2008-05-28T02:39:35+09:00 Subject: Re: A simple newbie question (arrays and strings) On Tue, May 27, 2008 at 12:14 PM, koichirose wrote: > Dave Bass wrote: > Ok, but those 2 lines are the same, except that with list2 I take the part > after ' - '. > If I do: > > #~ j=0 > #~ for i in list2 > #~ puts list2[j] > #~ j +=1 > #~ end You have entries that either have no dash "-", or have one but nothing after. You can NilClass#puts, but not just any method on it, such as #capitalize. If you don't need them (like, for example, counting purposes), remove your nils out of the array list with #compact. Example in irb... [1, nil, 2].compact => [1, 2] Todd