Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- vector<string> splitString(const string &str, const string &delim)
- {
- size_t start = 0, delimPos = 0;
- vector<string> result;
- do
- {
- delimPos = str.find(delim, start);
- result.push_back(string(str, start, delimPos-start));
- start = delimPos + delim.length();
- } while(delimPos != string::npos);
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement