fork(6) download
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5.  
  6. public class Test
  7. {
  8. public static void Main()
  9. {
  10. var s = "cC-Cc";
  11. var result = Regex.Replace(s, @"(?i)^([a-z]{2})-([a-z]{2})$", m =>
  12. $"{m.Groups[1].Value.ToLower()}-{m.Groups[2].Value.ToUpper()}");
  13. Console.WriteLine(result);
  14. }
  15. }
Success #stdin #stdout 0.07s 19456KB
stdin
Standard input is empty
stdout
cc-CC