I've got following code:
auto rrr="my mixed string"s;
rrr.erase(std::remove_if(std::begin(rrr), std::end(rrr), [](char const c) { return c == 'm'; }));
std::cout<<rrr<<std::endl;
The output is y ixed stringg
I expected for the code to just remove every m in the string, instead it also added a g at the end
Why did this happen, and how do I fix this?