
Dear all, I was trying to remove (replace, find...) characters from a string through the handy classification class. Unfortunately there is no erase_if fct which can be fed with this predicate functions. There is a trim_if function, but this trims only. It would be handy if all these '_if' variants where implemented for find, repalce and erase. Also the 'any' (or contains_if with predicate) is something we need regularly. But maybe this functionality can be achieved in another way. Anyone an idea? Remove_if/erase combination does of course work, but these are quite cumbersome. Wkr, me

Dear all, Ok as described in the documentation one can always fallback to the basic format functions. For example removing unreadable characters could be solved then: std::string str = _T("abcdefgbc"); str[1] = 12; str[4] = 12; boost::find_format_all(str, boost::token_finder(!boost::is_print()), boost::empty_formatter("")); Still an 'erase_if' would be far more readable: boost::erase_if(str, !boost::is_print()); wkr, me
participants (1)
-
gast128