The thing is I usually would use a for loop to handle this kind of thing but this method seems to be much more efficient. I apologize in advance for this question, but the documentation on cplusplus was a bit hard to comprehend for me given I am quite new at c++
std::string no_space(std::string x)
{
x.erase(std::remove(x.begin(), x.end(), ' '), x.end());
return x;
}
Aucun commentaire:
Enregistrer un commentaire