Method: Array#replace
- Defined in:
- lib/source/ruby.rb
#replace(other) ⇒ Object
call-seq:
ary.replace(other) -> ary
Replaces the contents of ary with the contents of other, truncating or expanding if necessary.
a = %w(a b c)
a.replace(%w(w x y z)) #=> ["w", "x", "y", "z"]
a #=> ["w", "x", "y", "z"]
2558 2559 2560 |
# File 'lib/source/ruby.rb', line 2558 def replace(other) `this._replace(other)` end |