Repeat a string: Difference between revisions

Line 350:
return new String(new char[times]).replace("\0", str);
}</lang>
 
In Apache Commons Lang, there is a [http://commons.apache.org/lang/api-2.6/org/apache/commons/lang/StringUtils.html#repeat%28java.lang.String,%20int%29 StringUtils.repeat()] method.
 
=={{header|JavaScript}}==
Anonymous user