Boost logo

Boost Users :

Subject: [Boost-users] String split behaviour
From: Venkateswara Rao Sanaka (moderncpp.venki_at_[hidden])
Date: 2015-05-20 14:32:16


Hi,

I am getting two empty strings from the following program,

void boost_split_test() {

    const string &text("-");

    vector<string> tokens;

    split(tokens, text, boost::is_any_of("-"), token_compress_on);

    cout << "size of tokens " << tokens.size() << '\n';

    for (auto const &e : tokens)

        cout << e.size() << '\n';

}

Output:

size of tokens 2
0
0

Is this expected output? I expecting an zero split parts. Could someone
clarify?

-- 
Thanks,
:) Venki.


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