instance method
String#include?
(::string other_string) -> bool
include?(other_string) → true or false
string.c
View on GitHub ↗
VALUE
rb_str_include(VALUE str, VALUE arg)
{
long i;
StringValue(arg);
i = rb_str_index(str, arg, 0);
return RBOOL(i != -1);
}
Returns whether self contains other_string:
Example
s = 'bar' s.include?('ba') # => true s.include?('ar') # => true s.include?('bar') # => true s.include?('a') # => true s.include?('') # => true s.include?('foo') # => false
Related: see Querying.