Advertisement
barybatle

zadanie 5 lancuchy

Nov 21st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 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 zad5lancuchy
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string s1 = "To jest tekst oryginalny ktory nalezy zamienic na tzw format CamelCase";
  14.  
  15.             string[] tab1 = s1.Split(' ');
  16.  
  17.             string[] tab3 = new string[tab1.Length];
  18.  
  19.             for (int i = 0; i < tab1.Length; i++)
  20.             {
  21.                 char[] tab2 = tab1[i].ToCharArray();
  22.  
  23.                 tab2[0] = Char.ToUpper(tab2[0]);
  24.  
  25.                 string s2 = new string(tab2);
  26.  
  27.                 tab3[i] = s2;
  28.             }
  29.             string s3 = string.Join(" ", tab3);
  30.  
  31.             Console.WriteLine(s1);
  32.  
  33.             Console.WriteLine(s3);
  34.  
  35.             string s4 = s3.Replace(" ","");
  36.  
  37.             Console.WriteLine(s4);
  38.            
  39.  
  40.             Console.ReadKey();
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement