Re: [string_algo] Split and Predicates
Thanks for your quick response, Pavol, this did the trick and cleared up my
misunderstanding. Might I suggest an overloaded version of split that takes
a string/character string as a delimiter. Althought the implementation
details are different, I still think it fits well into the intent of the
split algorithm and may clear up issue for others have the same problem as I
did.
Thanks again for your help!
David Brownell
"Pavol Droba"
Hi,
It is possible to achieve what you want quite easily. However, split algorithm is not the right tool for this. Split is a high level wrapper over the split_iterator and it is quite specialized.
So this is the code, that should work for you:
#include
#include static char const STRING[] = "this\r\nis\r\n\r\na test!";
typedef boost::split_iterator
char_split_iterator; for(char_split_iterator It=char_split_iterator(STRING, boost::first_finder("\r\n"); It!=char_split_iterator(); ++It) { cout << *It << endl; }
participants (1)
-
David Brownell