Advertisement
Gudini

Homework3_7

Dec 14th, 2024
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | Source Code | 0 0
  1. using System;
  2.  
  3. namespace Homework3_7
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string sentence = "Сегодня хороший день, чтобы погулять.";
  10.  
  11.             char[] separators = new char[] { ' ', '.', ',' };
  12.  
  13.             string[] words = sentence.Split(separators, StringSplitOptions.RemoveEmptyEntries);
  14.  
  15.             Console.WriteLine(sentence + "\n");
  16.  
  17.             foreach (string word in words)
  18.             {
  19.                 Console.WriteLine(word);
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement