Advertisement
csaki

szavak to titlecase

Oct 25th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Globalization;
  7.  
  8.  
  9. namespace szavakat_uppercasere
  10. {
  11.     class Program
  12.     {
  13.  
  14.         static string mondat;
  15.         static CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
  16.         static TextInfo textInfo = cultureInfo.TextInfo;
  17.         static void Main(string[] args)
  18.         {
  19.             bekérés();
  20.             végrehajtás();
  21.             kiírás();
  22.         }
  23.  
  24.         static void bekérés()
  25.         {
  26.             Console.WriteLine("Adjon meg egy több szóból álló mondatot.");
  27.             mondat = Console.ReadLine();
  28.         }
  29.  
  30.         static void végrehajtás()
  31.         {
  32.             mondat = textInfo.ToTitleCase(mondat);
  33.         }
  34.  
  35.         static void kiírás()
  36.         {
  37.             Console.WriteLine("\n\n*Varázslat történt* \n\nÍme:");
  38.             Console.WriteLine(mondat);
  39.             Console.ReadLine();
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement