Instance method
# start_with?
Returns true if sym starts with one of the prefixes given. Each of the prefixes should be a String or a Regexp.
How to use
Quick guide
Official content
Official how?
I scraped all this data from the official documentation. I created this site to make it easier for beginners and more pleasant for professionals to use Ruby.
Georgie boy
Creator of ruby-docs.org
Returns true if
sym
starts with one of the prefixes
given. Each of the prefixes
should be a String
or a Regexp
.:hello.start_with?("hell") #=> true
:hello.start_with?(/H/i) #=> true
# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
static VALUE
sym_start_with(int argc, VALUE *argv, VALUE sym)
{
return rb_str_start_with(argc, argv, rb_sym2str(sym));
}
Was this page useful?
Leave your feedback
Please hit 'submit' to confirm your feedback.
Leave your feedback
Please hit 'submit' to confirm your feedback.