initialize_copy

ary.replace(other_ary) â ary
Instance Public methods

Replaces the contents of self with the contents of other_ary, truncating or expanding if necessary.

1
2
3
a = [ "a", "b", "c", "d", "e" ]
a.replace([ "x", "y", "z" ])   #=> ["x", "y", "z"]
a                              #=> ["x", "y", "z"]
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.