Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- namespace Substring
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- string wordToRemove = Console.ReadLine().ToLower();
- string text = Console.ReadLine();
- while (text.Contains(wordToRemove))
- {
- int startIndex = text.IndexOf(wordToRemove);
- text = text.Remove(startIndex,wordToRemove.Length);
- }
- Console.WriteLine(text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement