This seems like such a basic question, so I apologize if he was already answered somewhere (my searches did not display anything).
I just want to filter a string object so that it contains only alphanumeric and white space characters.
Here is what I tried:
#include "boost/algorithm/string/erase.hpp"
#include "boost/algorithm/string/classification.hpp"
std::wstring oldStr = "Bla=bla =&*\nSampleSampleSample ";
std::wstring newStr = boost::erase_all_copy(oldStr, !(boost::is_alnum() ||
boost::is_space()));
But the compiler is not at all happy with this - it seems that I can only put a string in the second argument erase_all_copy, and not this stuff is_alnum().
Is there some obvious solution that I'm missing here?
Jen s source
share