diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-21 01:10:25 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-21 01:10:25 +0000 |
commit | aef19b44cac5f55a97f62df1dcf865df50fedf8c (patch) | |
tree | 9a44f28a93d3614e9bb28e70567ab18664d0261a /string.c | |
parent | f75174d7f17e97dcaf0533737399adfe3fb96b54 (diff) | |
download | ruby-aef19b44cac5f55a97f62df1dcf865df50fedf8c.tar.gz ruby-aef19b44cac5f55a97f62df1dcf865df50fedf8c.tar.xz ruby-aef19b44cac5f55a97f62df1dcf865df50fedf8c.zip |
* string.c (rb_str_partition): RDoc typo fixed. [ruby-core:08898]
* string.c (rb_str_rpartition): fixed separation seek bug.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -4413,7 +4413,7 @@ rb_str_center(int argc, VALUE *argv, VALUE str) * returns <i>str</i> and two empty strings. * * "hello".partition("l") #=> ["he", "l", "lo"] - * "hello".partition("x") #=> ["helo", "", ""] + * "hello".partition("x") #=> ["hello", "", ""] */ static VALUE @@ -4462,8 +4462,8 @@ rb_str_partition(int argc, VALUE *argv, VALUE str) * If <i>sep</i> is not found, returns two empty strings and * <i>str</i>. * - * "hello".partition("l") #=> ["he", "l", "lo"] - * "hello".partition("x") #=> ["helo", "", ""] + * "hello".rpartition("l") #=> ["hel", "l", "o"] + * "hello".rpartition("x") #=> ["", "", "hello"] */ static VALUE @@ -4484,7 +4484,7 @@ rb_str_rpartition(VALUE str, VALUE sep) rb_raise(rb_eTypeError, "type mismatch: %s given", rb_obj_classname(sep)); } - pos = rb_str_index(str, sep, pos); + pos = rb_str_rindex(str, sep, pos); } if (pos < 0) { return rb_ary_new3(3, rb_str_new(0,0),rb_str_new(0,0), str); |