Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static inline std::vector<std::string> splitString(const std::string& str, const std::string& delimiter)
- {
- std::vector<std::string> strings;
- std::string::size_type pos = 0;
- std::string::size_type prev = 0;
- while ((pos = str.find(delimiter, prev)) != std::string::npos)
- {
- strings.push_back(str.substr(prev, pos - prev));
- prev = pos + 1;
- }
- strings.push_back(str.substr(prev));
- return strings;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement