Advertisement
Spocoman

04. Text Filter

Apr 12th, 2023
712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace TextFilter
  6. {
  7.  
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             string[] filrered = Console.ReadLine().Split(", ");
  13.             string text = Console.ReadLine();
  14.  
  15.             for (int i = 0; i < filrered.Length; i++)
  16.             {
  17.                 text = text.Replace(filrered[i], new string('*', filrered[i].Length));
  18.             }
  19.  
  20.             Console.WriteLine(text);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement