From 2aa4ed2eb9dd53b745e1a6ea8b17da7f6271798e Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 12 Jul 2009 14:46:09 +0000 Subject: merges r23930 from trunk into ruby_1_9_1. -- * 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/branches/ruby_1_9_1@24051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 5440e3738..bf719b8ee 100644 --- a/string.c +++ b/string.c @@ -6624,13 +6624,16 @@ rb_str_center(int argc, VALUE *argv, VALUE str) /* * call-seq: * str.partition(sep) => [head, sep, 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. - * + * str.partition(regexp) => [head, match, tail] + * + * 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 @@ -6670,15 +6673,17 @@ rb_str_partition(VALUE str, VALUE sep) /* * call-seq: - * str.rpartition(sep) => [head, sep, 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. - * + * str.rpartition(sep) => [head, sep, tail] + * str.rpartition(regexp) => [head, match, tail] + * + * 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