| 8 | namespace obe::Utils::String |
| 9 | { |
| 10 | std::vector<std::string> split(const std::string& str, const std::string& delimiters) |
| 11 | { |
| 12 | std::vector<std::string> tokens; |
| 13 | std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); |
| 14 | std::string::size_type pos = str.find_first_of(delimiters, lastPos); |
| 15 | while (std::string::npos != pos || std::string::npos != lastPos) |
| 16 | { |
| 17 | tokens.push_back(str.substr(lastPos, pos - lastPos)); |
| 18 | lastPos = str.find_first_not_of(delimiters, pos); |
| 19 | pos = str.find_first_of(delimiters, lastPos); |
| 20 | } |
| 21 | return tokens; |
| 22 | } |
| 23 | |
| 24 | int occurencesInString(const std::string& str, const std::string& occur) |
| 25 | { |
no test coverage detected