L
Lee Griffiths
I would like to avoid doing :
Array.index(Enumerable.find { |blarg| blarg =~ /blah/ })
as that traverses the array twice. Is there any built in method that
does this for me? That is, it's a method that takes a block and returns
the index of the first element for which this block returns true?
Thanks
Array.index(Enumerable.find { |blarg| blarg =~ /blah/ })
as that traverses the array twice. Is there any built in method that
does this for me? That is, it's a method that takes a block and returns
the index of the first element for which this block returns true?
Thanks