I suggested that you use the split function as below
string text = "1,,3,4";
list<string> tokenList;
split(tokenList, text, is_any_of(","));
BOOST_FOREACH(string t, tokenList)
{
cout << t << "." << endl;
}
If you carefully study the split prototype here
you will see the default option at the end!
So, now in your call use explicit token_compress_offfor the last parameter, and that will be fine.
split(tokenList, text, is_any_of(","), token_compress_off);
source
share