Advertisement
Guest User

Untitled

a guest
Jun 7th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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. Console.Write(input[i] + " ");
  20. }
  21. //Console.WriteLine(input);
  22. }
  23. static string UpperFirstLetter(string s)
  24. {
  25. char[] a = s.ToCharArray();
  26. a[0] = char.ToUpper(a[0]);
  27. return new string(a);
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement