Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Text_Filter_Lab_TextProcessing
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] banWords = Console.ReadLine()
- .Split(", ");
- string text = Console.ReadLine();
- foreach (var banWord in banWords)
- {
- if (text.Contains(banWord))
- {
- text = text.Replace(banWord, new string('*', banWord.Length));
- }
- }
- Console.WriteLine(text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement