Advertisement
SPavelA

string split to array

Sep 6th, 2023 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1.             char splitSymbol = ' ';
  2.             string userInput;
  3.             string[] wordsArray;
  4.  
  5.             Console.WriteLine("Введите строку текста:");
  6.             userInput = Console.ReadLine();
  7.             wordsArray = userInput.Split(splitSymbol);
  8.  
  9.             for (int i = 0; i < wordsArray.Length; i++)
  10.             {
  11.                 Console.WriteLine(wordsArray[i]);
  12.             }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement