SaNik74

split

Mar 9th, 2023 (edited)
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System;
  2.  
  3. internal class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         char spaceInText = ' ';
  8.  
  9.         Console.Write("Введите текст: ");
  10.  
  11.         string textLine = Console.ReadLine();
  12.         string[] words = textLine.Split(spaceInText);
  13.  
  14.         foreach (string word in words)
  15.         {
  16.             Console.WriteLine(word);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment