As for copying you can do:
phrase2 = phrase1.dup
or
# Clone: copies singleton methods as well
phrase2 = phrase1.clone
You can do this as well to avoid copying at all:
phrase2 = phrase1.gsub("Hello","Hi")
As for copying you can do:
phrase2 = phrase1.dup
or
# Clone: copies singleton methods as well
phrase2 = phrase1.clone
You can do this as well to avoid copying at all:
phrase2 = phrase1.gsub("Hello","Hi")