Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace TextFilter
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- string[] bannedWords = Console.ReadLine().Split(", ",StringSplitOptions.RemoveEmptyEntries);
- string text = Console.ReadLine();
- foreach (var word in bannedWords)
- {
- while (text.Contains(word))
- {
- text = text.Replace(word, new string('*', word.Length));
- }
- }
- Console.WriteLine(text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement