fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. String pattern = "( +)";
  9. String substitution = "$1 ";
  10. String input = "a b c d e";
  11. RegexOptions options = RegexOptions.Multiline;
  12.  
  13. Regex regex = new Regex(pattern, options);
  14. string result = regex.Replace(input, substitution);
  15. Console.WriteLine(result);
  16. }
  17. }
Success #stdin #stdout 0.03s 134080KB
stdin
Standard input is empty
stdout
a  b   c    d     e