开发者

boost split usage

开发者 https://www.devze.com 2023-02-19 02:07 出处:网络
I have a string of format [id1,id2,id3]. i\'m using boost split to split the string and fill it in a vector.

I have a string of format [id1,id2,id3]. i'm using boost split to split the string and fill it in a vector.

boost::split(ids, message, boost::is_any_of("[, ]"));

ids is my vector declared a开发者_StackOverflow中文版s std::vector<std::string> ids.

now only the odd indices of the vector contains the ids, the even ones are empty. can anyone tell me what could be the reason and how to fix it.


boost::algorithm::split( ids, message, boost::is_any_of("[, ]"),
                         boost::algorithm::token_compress_on );
0

精彩评论

暂无评论...
验证码 换一张
取 消