svetliovd

Untitled

Aug 4th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.91 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 capitalize
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             while (true)
  14.             {
  15.                 string[] input = Console.ReadLine()
  16.                     .Split(new char[] {' ',',','.','!','?','[',']','{','}','/','\\','@','#','$','%','^','&','*','(',')','-','_','|','<','>','+',':',';','~','`', }
  17.                     , StringSplitOptions.RemoveEmptyEntries).ToArray();
  18.                 if (input[0] == "end") { break; }
  19.                 for (int i = 0; i < input.Length; i++)
  20.                 {
  21.                     input[i] = input[i].ToLower();
  22.                     input[i] = char.ToUpper(input[i][0]) + input[i].Substring(1);
  23.                 }
  24.                 Console.WriteLine(string.Join(", ", input));
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment