On 2/20/07, Pavol Droba
Hi,
There is realy no magic there. You just need to realize, that you are not getting a string, rather a range. Range is a generalization of a pair of iterators.
In case of split_iterator, these iterators point to first and one past the last character of the current token.
Example can be found in /boost/libs/algorithm/string/example/split_example.cpp
Regards, Pavol.
Thanks for your help. I have another question, how can I can i terminate the for loop when loop using string_split? class integer_compare { public: bool operator() (const string_split::value_type &a, const string_split::value_type &b) { // how can I iterate thru the string? how can i terminate the for loop? for (const string_split sitr = a; sitr != ???; sitr++) { // print out each substring (after '/' is stripped out) cout << copy_rangestd::string(*sitr) << endl; } return true; } };
Meryl Silverburgh wrote:
hi,
Can someone please tell me where I can find example of split_iteratorstring::iterator
If I have 2 split_iteratorstring::iterators, how can I compare the 2 strings that the split_iterator pointing to?
Thank you. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users