Increase the use of separation

I have a format string [id1,id2,id3] . I use boost split to split the string and fill it with a vector.

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

ids is my vector declared as std::vector<std::string> ids .

now only the odd indices of the vector contain ides, even - empty. can someone tell me what could be the cause and how to fix it.

+4
source share
1 answer
 boost::algorithm::split( ids, message, boost::is_any_of("[, ]"), boost::algorithm::token_compress_on ); 
+7
source

Source: https://habr.com/ru/post/1344749/


All Articles