NikaBang

ДЗ: Split

Oct 22nd, 2025
627
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | Gaming | 0 0
  1. internal class Program
  2. {
  3.     static void Main(string[] args)
  4.     {
  5.         string text = "Дана строка с текстом, используя метод строки String.Split() получить массив слов";
  6.         char[] separators = { ' ', '.', ',', '(', ')' };
  7.         string[] words = text.Split(separators, StringSplitOptions.RemoveEmptyEntries);
  8.  
  9.         foreach (string word in words)
  10.         {
  11.             Console.WriteLine(word);
  12.         }
  13.  
  14.         Console.ReadKey();
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment