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;
- using System.Threading.Tasks;
- namespace ConsoleApplication7
- {
- class Program
- {
- static void Main(string[] args)
- {
- string pattern = Console.ReadLine();
- string input = Console.ReadLine();
- Console.WriteLine(RemoveTargeted(input, pattern));
- }
- static string RemoveTargeted(string input, string targeted)
- {
- string[] arrayTargeted = targeted.Split(new string[]{", "}, StringSplitOptions.None);
- foreach (var word in arrayTargeted)
- {
- input = input.Replace(word, new string('*', word.Length));
- }
- return input;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment