From: Josselin Date: 2006-11-26T23:00:10+09:00 Subject: find index of first non zeo value in array with : array = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] I wrote : array.index(array.detect {|x| x > 0}) => 15 is there a better and simpler way to do it ? thanks joss