fork(32) download
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var inputString = "ñaáme";
  12. var result = string.Concat(Regex.Replace(inputString, @"(?i)[\p{L}-[ña-z]]+", m =>
  13. m.Value.Normalize(NormalizationForm.FormD)
  14. )
  15. .Where(c => CharUnicodeInfo.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark));
  16. Console.Write(result);
  17. }
  18. }
Success #stdin #stdout 0.05s 134720KB
stdin
Standard input is empty
stdout
ñaame