Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <string>
- void actuallyRemoveOccurrencesThanksYouVeryMuch(std::string& str, char charToRemove) {
- str.erase(std::remove(str.begin(), str.end(), charToRemove), str.end());
- }
- int main() {
- std::string s = "#Hello #World!!";
- actuallyRemoveOccurrencesThanksYouVeryMuch(s, '#');
- std::cout << s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement