Feature #4086: Feature request: add String#contain? and {Enumerable,Array}#contain? methods
http://redmine.ruby-lang.org/issues/show/4086

Author: Roger Pack
Status: Open, Priority: Normal

Hello all.

I debated this suggestion previously on ruby talk ( http://www.ruby-forum.com/topic/217473 ) and nobody seemed to have negative feedback, so here goes...

Currently Strings and Enumerables have a contain? method for searching for if one includes another.

I tend to "reach for" an include? method for the same, since it makes more sense in my head.  For instance "is this string included in that one? Does this array include this member?"

Since ruby is typically not averse to several ways to do the same thing (example: Array#{detect,find}, Array#{collect,map} etc.) I propose that 
new methods be added of String#contain? and {Enumerable,Array}#contain?

I'd be happy to code up a patch if it had a chance of being accepted.
Feedback welcome.
Cheers!
-roger


----------------------------------------
http://redmine.ruby-lang.org