Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<string> split(string str, string delim)
- {
- vector<string> result;
- int last = 0;
- int next = 0;
- while ((next = str.find(delim, last)) != str.npos)
- {
- result.push_back(str.substr(last, next - last));
- last = next + 1;
- }
- result.push_back(str.substr(last));
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement