I'm a beginner so bear with me.
I have a string and in it there is a character I want to remove.
What is the best way to remove it?
The shit I've found on the internet, it's making my head explode.
I found this:
str.erase(std::remove(str.begin(), str.end()), str.end());
Why is there a std::remove in the str.erase()? What does str.begin(), str.end() do if they're in std::remove?
string::iterator it; it=str.begin()+9; str.erase(it); cout << str << endl;
The line here I don't get is "string:;iterator it;" Because there's something magical happening there. I tried making a variable "it=9", it didn't work.
I'm going to sleep...