
Issue #19177 has been updated by byroot (Jean Boussier). Status changed from Open to Closed Closing as duplicate. @Dan0042 can you revive the previous issue? The principle was accepted indeed, but it seems there was still a few open questions. It's probably a bit late for 3.2, but would be worth trying to get this revived in January. ---------------------------------------- Feature #19177: optional offset for Array#index https://bugs.ruby-lang.org/issues/19177#change-100499 * Author: Dan0042 (Daniel DeLorme) * Status: Closed * Priority: Normal ---------------------------------------- String#index allows an optional offset: ```ruby "the quick brown fox jumps over the lazy dog".index("the") #=> 0 "the quick brown fox jumps over the lazy dog".index("the",1) #=> 31 ``` I was a bit surprised that Array doesn't support this and I feel it would be a very natural addition: ```ruby %w[the quick brown fox jumps over the lazy dog].index("the") #=> 0 %w[the quick brown fox jumps over the lazy dog].index("the",1) #=> 6 instead of ArgumentError ``` -- https://bugs.ruby-lang.org/