Boost logo

Boost Users :

From: David Brownell (david_brownell_at_[hidden])
Date: 2005-01-28 12:50:13

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

Thanks again for your help!
David Brownell

"Pavol Droba" <droba_at_[hidden]> wrote in message
> Hi,
> It is possible to achieve what you want quite easily. However, split
> is not the right tool for this.
> Split is a high level wrapper over the split_iterator and it is quite
> So this is the code, that should work for you:
> #include <boost/algorithm/string/find_iterator.hpp>
> #include <boost/algorithm/string/finder.hpp>
> static char const STRING[] = "this\r\nis\r\n\r\na test!";
> typedef boost::split_iterator<const char*> char_split_iterator;
> for(char_split_iterator It=char_split_iterator(STRING,
> It!=char_split_iterator();
> ++It)
> {
> cout << *It << endl;
> }

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at