Remove whitespace from string c++

Remove whitespace from string c++ Remove whitespace from string c++ :-  The best thing to do is to use the algorithm remove_if and isspace: remove_if(str.begin(), str.end(), isspace); Now the algorithm itself can’t change the container(only modify the values), so it actually shuffles the values around and returns a pointer to where the end now should be. So we … Read more