Repeat a string: Difference between revisions
Content added Content deleted
Line 350: | Line 350: | ||
return new String(new char[times]).replace("\0", str); |
return new String(new char[times]).replace("\0", str); |
||
}</lang> |
}</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}}== |
=={{header|JavaScript}}== |