📜  c++ 用几个空格分割字符串 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:51.796000             🧑  作者: Mango

代码示例1
std::string s = "split on    whitespace   "; 
std::vector result; 
std::istringstream iss(s); 
for(std::string s; iss >> s; ) 
    result.push_back(s);