Boost logo

Boost Users :

From: Seth Nielson (sethjn_at_[hidden])
Date: 2006-07-25 02:33:09


Thanks. For the record, I had to make one small correction.

{
   results.push_back(copy_range<std::string>(*it));
}

because *it was just a range.

-- Seth N.

Thore B.Karlsen wrote:
> On Mon, 24 Jul 2006 14:53:51 -0500, Seth Nielson <sethjn_at_[hidden]>
> wrote:
>
>
>> No, that won't suit my needs. Did you read my message? I said I need
>> MARK to be a substring, not a single character.
>>
>
> Use a split iterator:
>
> string str = "1ab2ab3";
> vector<string> results;
>
> typedef boost::split_iterator<std::string::iterator>
> string_split_iterator;
>
> for (string_split_iterator it = make_split_iterator(str,
> first_finder("ab")); it != string_split_iterator();
> ++it)
> {
> results.push_back(*it);
> }
>
> As for which one is preferable, I like the string algo library much
> better than I like the tokenizer library. It's very, very good.
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net