From: Brian Ford Date: 2008-12-19T09:08:27+09:00 Subject: [ruby-core:20670] [Feature #905] Add String.new(fixnum) to preallocate large buffer Issue #905 has been updated by Brian Ford. In Rubinius, we have found it useful to have String.pattern(size, value) where value can be a fixnum or a string. The string created will be size characters where value is repeated. For example: String.pattern(5, ?a) # => "aaaaa" String.pattern(5, " ") # => " " String.pattern(5, "110") # => "11011" Something like "ab" * 5 then becomes String.pattern("ab".size * 5, "ab"). ---------------------------------------- http://redmine.ruby-lang.org/issues/show/905 ---------------------------------------- http://redmine.ruby-lang.org