Created
January 16, 2013 15:21
-
-
Save XoseLluis/4547892 to your computer and use it in GitHub Desktop.
C# Extension Method to multiply a string n times
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
public static string Multiply(this string st, int times) | |
{ | |
//all merit for this so concise implementation goes to this guy: | |
//http://stackoverflow.com/a/8520023/169558 | |
return new StringBuilder().Insert(0, st, times).ToString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment