From: dblack@... Date: 2006-11-27T00:26:10+09:00 Subject: Re: find index of first non zeo value in array On Mon, 27 Nov 2006, dblack@wobblini.net wrote: > Or: > > c = array.each_with_index {|e,i| break i unless e.zero? } No, I'm wrong; that leaves c == a if there's no non-zero element. Ignore. David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org