Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public static class Extensions
  2. {
  3.     public static string Repeat(this char character, int frequency)
  4.     {
  5.         return new string(character, frequency);
  6.     }
  7.     public static string Repeat(this string content, int frequency)
  8.     {
  9.         var container = new StringBuilder(frequency * content.Length);
  10.         for (int i = 0; i < frequency; i++)
  11.         {
  12.             container.Append(content);
  13.         }
  14.         return container.ToString();
  15.     }
  16. }