fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. std::string str = "1a2b3c";
  9.  
  10. std::remove_if(str.begin(), str.end(), [](const int c) { return !isalpha(c); });
  11. std::cout << str;
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
abcb3c