Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TextFilter
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter banned word separated with \", \": ");
- string[] banList = Console.ReadLine().Split(", ");
- string text = Console.ReadLine();
- foreach (string word in banList)
- {
- int length = word.Length;
- string newOne = "";
- for(int i = 0; i < length; i++)
- {
- newOne += "*";
- }
- text = text.Replace(word, newOne);
- }
- Console.WriteLine(text);
- }
- }
- }
Add Comment
Please, Sign In to add comment