Being based on the same algorithm as Split, this function does not include the instances found to be "delimiters".
toSplit | container to be split. | |
predicate | predicate used to differentiate slices. | |
result | list of containers to which will be appended the results of the split. |
const std::string test( "This is a test." ) ; const char d = ' ' ;
typedef std::list<std::string> List ; List result ;
Split( test, d, result ) ;
int n = 0 ; for( List::iterator i = result.begin(); i != result.end(); ++i, ++n ) { std::cout << "item " << n << ": >" << *i << "<" << std::endl ; }
std::find_if