Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace C_Ijun
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- char separator = ' ';
- string text = "Дана строка с текстом, используя метод строки String.Split() получить массив слов, которые разделены пробелом в тексте и вывести массив, каждое слово с новой строки.";
- Console.WriteLine($"Изначальная строка: {text}");
- string[] arrayText = text.Split(separator);
- foreach (var subText in arrayText)
- {
- Console.WriteLine($"Слово: {subText}");
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement