Fast Way To Repeat a String



there is may way to do it , but I this the following extension method will be that fast and efficient way to repeat a string for a specific number of times , just add this method to a static class and you can call it like :

" ".Repeat(10);

public static string Repeat(this string value, int count)
{
    return new StringBuilder().Insert(0, value, count).ToString();
}

No comments:

Post a Comment