@@ -6648,11 +6648,13 @@ rb_str_gsub(int argc, VALUE *argv, VALUE str)
66486648 * call-seq:
66496649 * replace(other_string) -> self
66506650 *
6651- * Replaces the contents of +self+ with the contents of +other_string+:
6651+ * Replaces the contents of +self+ with the contents of +other_string+;
6652+ * returns +self+:
66526653 *
66536654 * s = 'foo' # => "foo"
66546655 * s.replace('bar') # => "bar"
66556656 *
6657+ * Related: see {Modifying}[rdoc-ref:String@Modifying].
66566658 */
66576659
66586660VALUE
@@ -12820,6 +12822,7 @@ Init_String(void)
1282012822 rb_define_singleton_method (rb_cString , "new" , rb_str_s_new , -1 );
1282112823 rb_define_singleton_method (rb_cString , "try_convert" , rb_str_s_try_convert , 1 );
1282212824 rb_define_method (rb_cString , "initialize" , rb_str_init , -1 );
12825+ rb_define_method (rb_cString , "replace" , rb_str_replace , 1 );
1282312826 rb_define_method (rb_cString , "initialize_copy" , rb_str_replace , 1 );
1282412827 rb_define_method (rb_cString , "<=>" , rb_str_cmp_m , 1 );
1282512828 rb_define_method (rb_cString , "==" , rb_str_equal , 1 );
@@ -12850,7 +12853,6 @@ Init_String(void)
1285012853 rb_define_method (rb_cString , "byteindex" , rb_str_byteindex_m , -1 );
1285112854 rb_define_method (rb_cString , "rindex" , rb_str_rindex_m , -1 );
1285212855 rb_define_method (rb_cString , "byterindex" , rb_str_byterindex_m , -1 );
12853- rb_define_method (rb_cString , "replace" , rb_str_replace , 1 );
1285412856 rb_define_method (rb_cString , "clear" , rb_str_clear , 0 );
1285512857 rb_define_method (rb_cString , "chr" , rb_str_chr , 0 );
1285612858 rb_define_method (rb_cString , "getbyte" , rb_str_getbyte , 1 );
0 commit comments