Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace mid_exam
- {
- class Program
- {
- static void Main(string[] args)
- {
- string wordToFind = Console.ReadLine().ToLower();
- string sentence = Console.ReadLine();
- while (sentence.Contains(wordToFind))
- {
- int index = sentence.IndexOf(wordToFind);
- sentence = sentence.Remove(index, wordToFind.Length);
- }
- Console.WriteLine(sentence);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement