From: Robert Klemme Date: 2006-02-06T00:48:20+09:00 Subject: Re: Ruby feature request - enum.detect_index Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Ruby feature request - enum.detect_index" > on Sun, 5 Feb 2006 23:43:19 +0900, "jonT" writes: > >> detect works great but doesn't supply the index of the match. It >> would be nice to have a method detect_index that returned the index >> rather than the object. > > Nice idea. I'd rather name it 'find_index' though. Don't we have that already? >> %w{foo bar baz}.index "baz" => 2 Or am I missing something? Kind regards robert