Advertisement
Torgach

Split

Oct 15th, 2022
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 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 Основы.Практика
  8. {
  9.     class Program
  10.     {
  11.         static void Main()
  12.         {
  13.             string userString;
  14.             string[] stringArray;
  15.  
  16.             Console.Write("Введите строку: ");
  17.             userString = Console.ReadLine();
  18.  
  19.             stringArray = userString.Split(' ');
  20.  
  21.             Console.WriteLine();
  22.  
  23.             for (int i = 0; i < stringArray.Length; i++)
  24.             {
  25.                 Console.WriteLine($"{stringArray[i]}");
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement