Search

split 알고리즘

생성일
2023/05/16 13:45
태그
C++
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++
복사