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 s = "первое второе последнее";
  10. var res = Regex.Matches(s, @"\b\w+\b").OfType<Match>().Select(m => m.Value).Distinct();
  11. Console.WriteLine(String.Join(" ", res));
  12. }
  13. }
Success #stdin #stdout 0.03s 30240KB
stdin
Standard input is empty
stdout
первое второе последнее