From: Farrel Lifson Date: 2001-04-15T03:10:09+09:00 Subject: [ruby-talk:13665] Iterator Question Hi all, For a non numeric iterator is there a way to find out how many times the iterator has looped so far? For instance I have an array of strings and I want to indent everything except the 1st string. Currently I have to do it like this i = 0 array.each{|element| print "\t" unless i = 0 i = i+1 print element,"\n" } I have searched all the documentation available to me and can't find a way to do it without the i's. Any ideas? Thanks in advance Farrel Lifson -- |DNA Research Group mailto:flifson@cs.uct.ac.za |Dept. of Computer Science http://www.cs.uct.ac.za/~flifson |University of Cape Town +27-21-650-3799