
Can someone please tell me how to use boost::algorithm::is_alnum(). I first thought I could do std::string test boost::algorithm::is_alnum(test) but obviously the function doesn't take a string as a parameter. I've been searching for an example in the doc and on the web, but niet. an example would be greatly appreciated. Elisabeth

AMDG Elisabeth Benoit wrote:
Can someone please tell me how to use boost::algorithm::is_alnum(). I first thought I could do
std::string test boost::algorithm::is_alnum(test)
but obviously the function doesn't take a string as a parameter. I've been searching for an example in the doc and on the web, but niet.
an example would be greatly appreciated.
is_alnum() returns a unary function object that takes a character. std::string s("!($(@ U98"); std::cout << std::count_if(s.begin(), s.end(), boost::algorithm::is_alnum()); // prints 3 see also http://www.boost.org/doc/html/string_algo/reference.html#header.boost.algori... In Christ, Steven Watanabe
participants (2)
-
Elisabeth Benoit
-
Steven Watanabe