Advertisement
junniorrkaa

Split

Oct 23rd, 2024 (edited)
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | Source Code | 0 0
  1. using System;
  2.  
  3. namespace CSLight
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string text = "Не спрашивай, что нужно миру. Спроси себя, что делает тебя живым. Затем пойди и займись этим. Миру нужны живые люди.";
  10.             string[] lines = text.Split(' ','.');
  11.  
  12.             Console.WriteLine("Ваша строка: \n");
  13.  
  14.             foreach (string line in lines)
  15.             {
  16.                 Console.WriteLine("| " + line);
  17.             }
  18.  
  19.             Console.WriteLine("\n");
  20.             Console.ReadKey();
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement