Skip to content

Instantly share code, notes, and snippets.

@aaryan79831014
Created June 4, 2018 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaryan79831014/2fd9f0f2233a9a5aa1a76ec54c9b4b0f to your computer and use it in GitHub Desktop.
Save aaryan79831014/2fd9f0f2233a9a5aa1a76ec54c9b4b0f to your computer and use it in GitHub Desktop.
Repeat extension for String
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