Advertisement
Guest User

Text Filter

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