How about std::remove() instead: This combination is also known as the erase-remove idiom.
I got a string and I want to remove all the punctuations from it. How do I do that? I did some research and found that people use the ispunct() function (I tried that), but I cant seem to get it to work in my code. Anyone got any ideas?
To delete a single element, you could do: Or, to delete more than one element at once: