fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string ul = "The quick brown fox jumped over the lazy dog________ dog dog";
  7. cout << "before: " << ul << endl;
  8. string::size_type idx = ul.find("_");
  9. if (idx != string::npos) ul.erase(idx);
  10. cout << "after: " << ul << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
before: The quick brown fox jumped over the lazy dog________ dog dog
after: The quick brown fox jumped over the lazy dog