From 87ccf7e50a71a7fbfc2f2c428dde7513793fb740 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 1 Jun 2018 06:37:14 +0000 Subject: string.c: doc for [Feature #13712] * string.c (rb_str_start_with): [DOC] start_with? example with regexp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index 3f3432fe4a..3bd6c74b35 100644 --- a/string.c +++ b/string.c @@ -9611,8 +9611,10 @@ rb_str_rpartition(VALUE str, VALUE sep) * str.start_with?([prefixes]+) -> true or false * * Returns true if +str+ starts with one of the +prefixes+ given. + * Each +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 -- cgit v1.2.3