string teststr = "1,2,3,4,5";
boost::char_separator<char> separator(",");
boost::tokenizer<boost::char_separator<char> > tokens(teststr, separator);
boost::tokenizer<boost::char_separator<char> >::iterator token_iter;
map<string>numbermap;
for (token_iter = tokens.begin(); token_iter != tokens.end(); token_iter++)
numbermap.push_back(*token_iter);
boost 分割字符串并存入集合(类似php中的EXPLODE)
最新推荐文章于 2025-05-30 18:38:27 发布