Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _09.Capitalization
- {
- class Program
- {
- static void Main(string[] args)
- {
- char[] separators = { '.', ',', '?', '!', ';', ' ' };
- List<string> input = Console.ReadLine().Split(separators).ToList();
- for (int i = 0; i < input.Count; i++)
- {
- input[i] = UpperFirstLetter(input[i]);
- Console.Write(input[i] + " ");
- }
- //Console.WriteLine(input);
- }
- static string UpperFirstLetter(string s)
- {
- char[] a = s.ToCharArray();
- a[0] = char.ToUpper(a[0]);
- return new string(a);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement