String.new with block
After a discussion in our team chat today, I wondered if it would be a good idea to have a version of String.new that accepts a block and works as a string builder. Something like
string = String.new("foo") do |s| s << "bar" end string #=> "foobar"
If the argument is omitted an empty string would be passed to the block instead.
That could be a nice solution to avoid all the Array#join and "".tap hacks for string creation.