Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- class TextFilter
- {
- static void Main()
- {
- List<string> banWords = Convert.ToString(Console.ReadLine()).Split(',').Select(x => x.Trim()).ToList();
- StringBuilder censored = new StringBuilder(GetText());
- for (int i = 0; i < banWords.Count; i++)
- {
- int length = banWords[i].Length;
- string stars = new string('*', length);
- censored.Replace(banWords[i], stars);
- }
- Console.WriteLine(censored);
- }
- static string GetText()
- {
- //string newText = Console.ReadLine();
- string newText = "It is not Linux, it is GNU/Linux. Linux is merely the kernel, while GNU adds the functionality. Therefore we owe it to them by calling the OS GNU/Linux! Sincerely, a Windows client";
- return newText;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement