#include <iostream> #include <string> #include <sstream> using namespace std; int main() { string str="12 13 14 15"; string buf; stringstream ss(str); // 字符流ss while (ss >> buf) { cout<<buf<<endl; } return 0; }
600字范文,内容丰富有趣,生活中的好帮手!
时间:2022-06-01 20:49:36
#include <iostream> #include <string> #include <sstream> using namespace std; int main() { string str="12 13 14 15"; string buf; stringstream ss(str); // 字符流ss while (ss >> buf) { cout<<buf<<endl; } return 0; }
c语言将字符串按空格分割_如何在c++中实现字符串分割函数split详解
2023-03-09
Python 按行读取文件内按分隔符分割字符串(去除空格和换行 字符串分割)
2019-12-14