WindFell

CensorShip

May 28th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Censorship
  5. {
  6.     static void Main(string[] args)
  7.     {
  8.         string bannedWord = Console.ReadLine();
  9.         string input = Console.ReadLine();
  10.         string replacement = new string('*', bannedWord.Length);
  11.         string result= Regex.Replace(input, bannedWord, replacement);
  12.    
  13.         Console.WriteLine(result);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment