x = "abc"
y = x
x = "xyz"
puts y # abc
xx = "abc"
yy = xx
xx.gsub!(/c/, 'a')
puts yy # aba
小心石头之 Ruby 是指针还是实例
最新推荐文章于 2020-07-30 16:51:28 发布
x = "abc"
y = x
x = "xyz"
puts y # abc
xx = "abc"
yy = xx
xx.gsub!(/c/, 'a')
puts yy # aba