From: dblack@... Date: 2006-12-28T23:19:43+09:00 Subject: Re: range index Hi -- On Thu, 28 Dec 2006, Josselin wrote: > is there any dry way to get the index of an element in a range without > converting the range into an array ? > > ("A".."Z").each do | alpha | > -> puts alpha.index (?) or something like that .... <- > end ("A".."Z").each_with_index do |alpha,i| puts i end David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)