Advertisement
Guest User

05. Short Words Sorted

a guest
Oct 23rd, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ShortWordsSOrted
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. List<string> input = Console.ReadLine()
  15. .ToLower()
  16. .Split(new char[] { '.', ',', ':', ';', '(', ')', '[', ']', '"', '\'', '\\', '/', '!', '?', ' ' }
  17. , StringSplitOptions.RemoveEmptyEntries).Where(item => item.Length < 5).Distinct().OrderBy(x=> x)
  18. .ToList();
  19.  
  20.  
  21. Console.Write(string.Join(", ", input));
  22. Console.WriteLine();
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement