#include #include #include #include int main(int argc, char** argv) { char* buf = "aligator^bear^cat^dog^elephant^frog^giraffe^hippo^iguana^jaguar^kangaroo^leopard"; { boost::split_iterator end; for (boost::split_iterator iter(buf, boost::token_finder(boost::is_any_of("^"))) ; iter != end; iter++) { std::cout << *iter << std::endl; } } std::cout << "/////////////////////////////////////////////////////////////////////////////////////////////////////" << std::endl; std::string buf2 = "apple^banana^carrot^donut|egg^french fries^grape fruit|hamburger|ice cream^jello"; { boost::split_iterator end; for (boost::split_iterator iter(buf2, boost::token_finder(boost::is_any_of("^|"))) ; iter != end; iter++) { std::cout << *iter << std::endl; } } return 0; }