Being completely honest, I find your comments to HankMoody a little harsh, callous in some ways, and certainly opposing from the start - for no good reason.
And you were quite pushy in telling the OP what to should do - rather than advising them.
With this standoffish scenario between you and the OP, there is not much chance of them taking your advice, giving you feedback on them trying it or explaining why it is not necessary etc, and then you advising further.
I know there are many new users who dump their poorly written and badly formatted code which doesn't work, turn their back, and ask someone else to sort it, write them the working resolve, and explain what is wrong.
And I know how it feels to get sick and tired of this, especially when usually they get a (bloody) answer as well!
But there is nothing you can do about it other than use the tools provided - comments, votes, flags, or leaving the question alone.
So if you are correct in your observations in their code won't even compile, then politely tell them this, and that they should resolve such issues before trying to resolve functionality issues within the code itself.
If they do not listen to your advice, then move on to someone who you can help.
Downvote and/or flag (unclear what asking etc) where required/applicable, and move on to another question where you can help someone.
You can lead a horse to water, but you can't make him drink.
Have a read through your comments as if they are someone else's, not yours, and see if you can see the wording and approach is a little sharp:
(Use of bold, double exclamation marks, telling OP what to do, not advising, standoffish - "don't tell me not to comment" - a little demanding in parts)
std::string.erase(
?? Really`?
Ehh what please?? You are in charge to provide a MCVE in 1st place!!
Or give us a clear questions about the compiler error messages you
get, to get a reasonable answer for your problems. Don't tell me not
to comment on your question, as long you're not in the position to
have a valid question asked, or find a valid reason to flag my
comment!
You are wasting my and other users time actually, while I took the
time trying to get your code to compile! Even if I remove the
std::string::erase there are so many errors in your code (e.g.
std::string.begin(), std::string.end() should be actually
str1.begin(), str1.end(), aso.). Either provide a valid sample as
mentioned in the link I gave you (compilable sample), or ask about
these compiler errors (include verbatim into your question), and how
you could fix them in 1st place.
BTW what's an "EOT"? And I also believe, you have "to get" something
more, about how the site works: Help Center)