#include <iostream>
#include <vector>
#include <string>
#include<sstream>
using namespace std;
vector<string> split(const string& text, char delimiter) {
string tmp;
vector<string> stk;
stringstream ss(text);
while(getline(ss,tmp, delimiter)) {
stk.push_back(tmp);
}
return stk;
}
int main() {
std::cout<<split("123-456-789",'-')[0]<< "\n";
return 0;
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询