Militsa

03. Text Filter

Nov 29th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. class TextFilter
  5. {
  6.     static void Main()
  7.     {
  8.         string[] word = Console.ReadLine().Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
  9.         StringBuilder text = new StringBuilder(Console.ReadLine());
  10.         string[] result = new string[word.Count()];
  11.  
  12.         for (int i = 0; i < word.Count(); i++)
  13.         {
  14.             result[i] = new string('*', word[i].Length);
  15.             text.Replace(word[i], result[i]);
  16.         }
  17.         Console.WriteLine(text);
  18.     }
  19. }
Add Comment
Please, Sign In to add comment