2020-10-07 c++ string spilt

    科技2024-08-05  25

    #include <iostream> #include <string> #include <bits/stdc++.h> using namespace std; int main() { string s = "a b,c,d e,f", tmps; stringstream ss(s); while (getline(ss, tmps, ',')) { cout << tmps << endl; } return 0; }

     

    Processed: 0.011, SQL: 8