Advertisement
Guest User

04. Text Filter

a guest
May 13th, 2015
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. class TextFilter
  7. {
  8.     static void Main()
  9.     {
  10.         string[] bannedWords = Console.ReadLine().Split(new char[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries);
  11.         string text = Console.ReadLine();
  12.         foreach (var word in bannedWords)
  13.         {
  14.             text = text.Replace(word, new string('*', word.Length));
  15.         }
  16.         Console.WriteLine(text);
  17.  
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement