I want to write contents on one String::Builder to another, like:
str1 = String::Builder.new
str2 = String::Builder.new
str1 << "foo"
str2 << "bar"
str1.copy_somehow_another_builder(str2) #=> "foobar"
currently I just str1 << str2.to_s
.
How to do it? And is to_s'ing and pushing is same as what I want from performance point of view?