Created
June 4, 2018 20:46
-
-
Save aaryan79831014/2fd9f0f2233a9a5aa1a76ec54c9b4b0f to your computer and use it in GitHub Desktop.
Repeat extension for String
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 class StringExtensions | |
{ | |
public static string Repeat(this string instr, int n) | |
{ | |
var result = string.Empty; | |
for (var i = 0; i < n; i++) | |
result += instr; | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment