Advertisement
Guest User

Split

a guest
Dec 12th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         string name = "Joro";
  8.         string[] arr = Split(name);
  9.  
  10.         foreach (var letter in arr)
  11.         {
  12.             Console.WriteLine(letter);
  13.         }
  14.     }
  15.  
  16.     static string[] Split(string txt)
  17.     {
  18.         string[] arr = new string[txt.Length];
  19.  
  20.         for (int index = 0; index < txt.Length; index++)
  21.         {
  22.             arr[index] = txt[index].ToString();
  23.         }
  24.  
  25.         return arr;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement