fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var r = Regex.Replace("a b c d e f g", @"^(\w)\s*(\w)\s*(\w)\s*(\w)", "$1$2$3$4");
  9. Console.WriteLine(r);
  10. }
  11. }
Success #stdin #stdout 0.08s 24480KB
stdin
Standard input is empty
stdout
abcd e f g