Created
July 23, 2011 05:37
-
-
Save rafaelrinaldi/1101070 to your computer and use it in GitHub Desktop.
Repeat a String how many times you want.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param p_string String to be repeated. | |
* @param p_times How many times the string will be repeated. | |
* | |
* @return A new instance with the string repeated. | |
* | |
* @author Rafael Rinaldi (rafaelrinaldi.com) | |
* @since 25/03/2011 | |
* | |
* */ | |
function repeat( p_string : String, p_times : Number ) : String | |
{ | |
return new Array(p_times + 1).join(p_string); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment