Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<std::string> get_tokens(std::string str, char start_delim = '<', char end_delim = '>')
- {
- unsigned int first = 0, last = 0;
- std::vector<std::string> tokens {};
- while (first != std::string::npos) {
- first = str.find(start_delim);
- last = str.find(end_delim);
- tokens.push_back(str.substr(first+1,last-first-1));
- str = str.substr(last, std::string::npos);
- }
- return tokens;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement