Advertisement
lightb01

Split

Jul 1st, 2022
581
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CSTemp
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string text;
  14.             string[] textSplit;
  15.  
  16.             Console.Write("Введите строку: ");
  17.             text = Console.ReadLine();
  18.             textSplit = text.Split(' ');
  19.             foreach(var word in textSplit)
  20.             {
  21.                 Console.WriteLine(word);
  22.             }
  23.             Console.ReadKey();
  24.         }
  25.     }
  26. }
Advertisement
RAW Paste Data Copied
Advertisement