C++中如何split字符串(转)

#include <iostream>
#include <sstream>
#include <string>
using namespace std;

int main()
{
    string s("Somewhere down the road");
    istringstream iss(s);
        
     while (iss)
    {
        string sub;
        iss >> sub;
        cout << "Substring: " << sub << endl;
    }
    

    system("pause");
}

效果图:

C++中如何split字符串(转)

C++中如何split字符串(转),布布扣,bubuko.com

C++中如何split字符串(转)

上一篇:Spring Boot MyBatis注解:@MapperScan和@Mapper


下一篇:数学之路-python计算实战(16)-机器视觉-滤波去噪(邻域平均法滤波)