| 398 | } |
| 399 | |
| 400 | std::vector<std::string> split(const std::string &text, char sep) { |
| 401 | std::vector<std::string> tokens; |
| 402 | std::size_t start = 0, end = 0; |
| 403 | while ((end = text.find(sep, start)) != std::string::npos) { |
| 404 | if (end != start) { |
| 405 | tokens.push_back(text.substr(start, end - start)); |
| 406 | } |
| 407 | start = end + 1; |
| 408 | } |
| 409 | if (end != start) { |
| 410 | tokens.push_back(text.substr(start)); |
| 411 | } |
| 412 | return tokens; |
| 413 | } |
| 414 | |
| 415 | std::string join(const std::vector<std::string> &text, char sep) |
| 416 | { |
no test coverage detected