Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns true if self contains other_string, false otherwise:
s = 'foo'
s.include?('f')    # => true
s.include?('fo')   # => true
s.include?('food') # => false
 
               static VALUE
rb_str_include(VALUE str, VALUE arg)
{
    long i;

    StringValue(arg);
    i = rb_str_index(str, arg, 0);

    return RBOOL(i != -1);
}
            

Was this page useful?