aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-01 06:37:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-01 06:37:14 +0000
commit87ccf7e50a71a7fbfc2f2c428dde7513793fb740 (patch)
tree4e2808f674fb33799a9d7bc384b4545941e6ae14 /string.c
parentfef8339f582b125e1fec5f3d47adbb48f7cede92 (diff)
downloadruby-87ccf7e50a71a7fbfc2f2c428dde7513793fb740.tar.gz
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
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 2 insertions, 0 deletions
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