#include<iostream>
#include<algorithm>
using namespace std;
main() {
string my_str = "ABAABACCABA";
cout << "Initial string: " << my_str << endl;
my_str.erase(remove(my_str.begin(), my_str.end(), 'A'), my_str.end()); //remove A from string
cout << "Final string: " << my_str;
}
#include <algorithm>
str.erase(std::remove(str.begin(), str.end(), 'a'), str.end());
static void StrRemoveChar(std::string& s1, char l)
{
s1.erase(std::remove(s1.begin(), s1.end(), l), s1.end());
}