From: "rogerdpack (Roger Pack)" Date: 2012-07-14T14:25:28+09:00 Subject: [ruby-core:46406] [ruby-trunk - Feature #4086] Feature request: add String#contain? and {Enumerable,Array}#contain? methods Issue #4086 has been updated by rogerdpack (Roger Pack). > The proposal is ambiguous. Only valid point I see is String#contain? might be more intuitive than String#include?, but I don't see the need for method addition. Yes because of being more intuitive, at least for this user. ---------------------------------------- Feature #4086: Feature request: add String#contain? and {Enumerable,Array}#contain? methods https://bugs.ruby-lang.org/issues/4086#change-28025 Author: rogerdpack (Roger Pack) Status: Rejected Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: =begin 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 =end -- http://bugs.ruby-lang.org/