Advertisement
Spocoman

03. Substring

Apr 12th, 2023
700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace Substring
  6. {
  7.  
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             string sub = Console.ReadLine();
  13.             string str = Console.ReadLine();
  14.  
  15.             while (str.Contains(sub))
  16.             {
  17.                 str = str.Replace(sub, "");
  18.             }
  19.  
  20.             Console.WriteLine(str);
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement