Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 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 _09.Capitalization
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. char[] separators = {'.',',','?','!',';',' ' };
  14. List<string> input = Console.ReadLine().Split(separators).ToList();
  15.  
  16. for (int i = 0; i < input.Count; i++)
  17. {
  18. input[i] = UpperFirstLetter(input[i]);
  19. }
  20. Console.WriteLine(input);
  21. }
  22. static string UpperFirstLetter(string s)
  23. {
  24. char[] a = s.ToCharArray();
  25. a[0] = char.ToUpper(a[0]);
  26. return new string(a);
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement