From ce250582e4b7224a8f46b5cb4665e0d315068e80 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 1 Jul 2009 21:20:44 +0000 Subject: * hash.c (rb_hash_hash): documentation fix. a patch from Marc-Andre Lafortune. [ruby-core:23943] * object.c (rb_mod_cmp): ditto. * range.c (range_eq): ditto. * string.c (rb_str_partition, rb_str_rpartition): ditto. * struct.c (rb_struct_s_def): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index c9561208a..9418bfe2c 100644 --- a/string.c +++ b/string.c @@ -6884,13 +6884,16 @@ rb_str_center(int argc, VALUE *argv, VALUE str) /* * call-seq: * str.partition(sep) => [head, sep, tail] + * str.partition(regexp) => [head, match, tail] * - * Searches the string for sep and returns the part before - * it, the sep, and the part after it. If sep is not found, - * returns str and two empty strings. + * Searches sep or pattern (regexp) in the string + * and returns the part before it, the match, and the part + * after it. + * If it is not found, returns two empty strings and str. * * "hello".partition("l") #=> ["he", "l", "lo"] * "hello".partition("x") #=> ["hello", "", ""] + * "hello".partition(/.l/) #=> ["h", "el", "lo"] */ static VALUE @@ -6930,15 +6933,17 @@ rb_str_partition(VALUE str, VALUE sep) /* * call-seq: - * str.rpartition(sep) => [head, sep, tail] + * str.rpartition(sep) => [head, sep, tail] + * str.rpartition(regexp) => [head, match, tail] * - * Searches sep in the string from the end of the string, and - * returns the part before it, the sep, and the part after it. - * If sep is not found, returns two empty strings and - * str. + * Searches sep or pattern (regexp) in the string from the end + * of the string, and returns the part before it, the match, and the part + * after it. + * If it is not found, returns two empty strings and str. * * "hello".rpartition("l") #=> ["hel", "l", "o"] * "hello".rpartition("x") #=> ["", "", "hello"] + * "hello".rpartition(/.l/) #=> ["he", "ll", "o"] */ static VALUE -- cgit