From: Tom Link Date: 2009-02-02T16:07:32+09:00 Subject: Re: ruby string question > Is it possible to modify an existing ruby string without creating a new > one ? > [...] > between asigning values , the object_id() is different I could be totally wrong but IMHO you're asking for two different things. As soon as you have something like "second string" in your code you will create a second string. You can assign this to the variable (the variable's value will have a different object_id) or replace its content with that string (the variables value will have same object_id as before but in between you created a second string). 3.times do puts "---------" x = "one".tap {|s| puts "one #{s.object_id}"} p x, x.object_id x.replace("two".tap {|s| puts "two #{s.object_id}"}) p x, x.object_id end