fork 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 str = "AXBY@@CZ@A";
  10. var matches = Regex.Matches(str, "@@|[ABC]").Cast<Match>();
  11. var replaced = string.Join("?", matches.Select(x => x.Value));
  12. Console.WriteLine(replaced);
  13. }
  14. }
Success #stdin #stdout 0.03s 30712KB
stdin
Standard input is empty
stdout
A?B?@@?C?A