C++ remove()

  다른 뜻에 대해서는 C++ cstdio remove() 문서를 참조하십시오.

1 개요[ | ]

C++ remove()
C++
Copy
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    string s = "Hello World!";
    remove(s.begin(), s.end(), 'l');
    cout << s << endl;
    // Heo Word!ld!
}
C++
Copy
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    string s = "Hello World!";
    s.erase(remove(s.begin(), s.end(), 'l'), s.end());
    cout << s << endl;
    // Heo Word!
}

2 같이 보기[ | ]

3 참고[ | ]