Character segmentation of c++ string string

record it

std::vector<std::string> tokens;
std::stringstream iss(txtLine);
 std::string token;
 while (std::getline(iss, token, ':'))
 {
    
    
     tokens.push_back(token);
 }

Remember to add the corresponding header file

Guess you like

Origin blog.csdn.net/sdhdsf132452/article/details/133135158