How can I in C++ remove all specified characters from the string?
For example If I have a string " &New &York " and I want to remove the characters from the set {' ','&'} ,the string after removing will look like "NewYork".
I prefer not to write a function which iterates a string and checks for each char in string if it is part of the undesired set.
How can I in C++ remove all specified characters from the string? For example
Share
You can try this: