fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4.  
  5. int main() {
  6. std::string str="ro.we.r";
  7. std::cout<<"before: str="<<str<<'\n';
  8.  
  9. str.erase(remove(str.begin(), str.end(), '.'), str.end());
  10.  
  11. std::cout<<"after: str="<<str<<'\n';
  12. return 0;
  13. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
before: str=ro.we.r
after: str=rower