fork download
  1. using System;
  2. using System.Text;
  3.  
  4. public static class StringExtensions
  5. {
  6. public static string Repeat(this string input, int count)
  7. {
  8. if (input == null)
  9. {
  10. return null;
  11. }
  12.  
  13. var sb = new StringBuilder();
  14.  
  15. for (var repeat = 0; repeat < count; repeat++)
  16. {
  17. sb.Append(input);
  18. }
  19.  
  20. return sb.ToString();
  21. }
  22. }
  23.  
  24. public class Test
  25. {
  26. public static void Main()
  27. {
  28. Console.Out.WriteLine("Hello".Repeat(3));
  29. }
  30. }
Success #stdin #stdout 0.03s 24072KB
stdin
Standard input is empty
stdout
HelloHelloHello