optybg

Untitled

Apr 4th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. class SentenceSplit
  5. {
  6.     static void Main()
  7.     {
  8.         var text = Console.ReadLine();
  9.  
  10.         var delimiter = Console.ReadLine();
  11.  
  12.         var resultText = text.Split(new string[] { delimiter }, StringSplitOptions.RemoveEmptyEntries);
  13.  
  14.         var result = new StringBuilder();
  15.  
  16.         result.Append("[" + string.Join(", ", resultText) + "]");
  17.  
  18.         Console.WriteLine(result);
  19.  
  20.  
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment