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