fork(1) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var s = "The%20%20%20%20%20%20%20%20%20%20Park";
  9. var regex = new Regex("(%20)+", RegexOptions.ExplicitCapture);
  10. var output = regex.Replace(s, "-");
  11. Console.WriteLine(output);
  12.  
  13. output = string.Join("-", s.Split(new[] {"%20"}, StringSplitOptions.RemoveEmptyEntries));
  14. Console.WriteLine(output);
  15. }
  16. }
Success #stdin #stdout 0.03s 30384KB
stdin
Standard input is empty
stdout
The-Park
The-Park