fork(3) download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var s = "My name is Adam";
  10. var result = Regex.Replace(s, @"(\p{Lu})|\S", m =>
  11. m.Groups[1].Success ? "X" : "x");
  12. Console.WriteLine(result);
  13. }
  14. }
Success #stdin #stdout 0.07s 19532KB
stdin
Standard input is empty
stdout
Xx xxxx xx Xxxx