Hi --

On Sun, 8 Jun 2008, David Masover wrote:

> If you're trying to do it on an array, maybe something like:
>
> 0.upto(a.length-1) { |i| a[i] += 9 }

You could also use each_index there:

   a.each_index {|i| a[i] += 9 }

or even:

   a.map! {|e| e + 9 }


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   INTRO TO RAILS         June 9-12            Berlin
   ADVANCING WITH RAILS   June 16-19           Berlin
   ADVANCING WITH RAILS   July 21-24           Edison, NJ
See http://www.rubypal.com for details and updates!