Advertisement
Spocoman

03. Substring

Nov 20th, 2023
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     string sub, str;
  8.     cin >> sub >> str;
  9.  
  10.     while (str.find(sub) != -1) {
  11.         str.erase(str.find(sub), sub.length());
  12.     }
  13.  
  14.     cout << str << endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement