c++ split 알고리즘!
vector<string> split(string input, string delimiter) {
vector<string> result;
long long pos = 0;
string token = "";
while ((pos = input.find(delimiter)) != string::npos) {
token = input.substr(0, pos);
result.push_back(token);
input.erase(0, pos + delimiter.length());
}
result.push_back(input);
return result;
}
C++
복사