Advertisement
elena1234

SubstringWithReplace()

Nov 12th, 2020 (edited)
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.Text;
  3.  
  4. namespace Substring
  5. {
  6.     class MainClass
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.           string wordToRemove = Console.ReadLine().ToLower();
  11.           string text = Console.ReadLine();
  12.             while (text.Contains(wordToRemove))
  13.             {
  14.               text = text.Replace(wordToRemove, string.Empty);
  15.             }
  16.  
  17.           Console.WriteLine(text);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement