Advertisement
DJColdBrain

Untitled

Jun 12th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 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 _04.Split_by_Word_Casing
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. List<string> words = Console.ReadLine().Split(' ', '!', '(', ')', ',' , '.' ,'\'', '\"' , ':' , ';' ,'[' , ']',
  14. '\\','/').ToList();
  15.  
  16. List<string> upperCase = new List<string>();
  17. List<string> lowerCase = new List<string>();
  18. List<string> mixedCase = new List<string>();
  19.  
  20. foreach (var word in words)
  21. {
  22. if (word != "")
  23. {
  24.  
  25.  
  26. if (word.All(char.IsUpper))
  27. {
  28. upperCase.Add(word);
  29. }
  30.  
  31. else if (word.All(char.IsLower))
  32. {
  33. lowerCase.Add(word);
  34. }
  35. else
  36. {
  37. mixedCase.Add(word);
  38. }
  39. }
  40. }
  41.  
  42. Console.WriteLine("Lower-case: " + string.Join(", ", lowerCase));
  43. Console.WriteLine("Mixed-case: " + string.Join(", ", mixedCase));
  44. Console.WriteLine("Upper-case: " + string.Join(", ", upperCase));
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement