| 65 | } |
| 66 | |
| 67 | void replaceAll(std::string& s, const std::string& item, const std::string& replacement) { |
| 68 | size_t pos = 0; |
| 69 | while ((pos = s.find(item, pos)) != std::string::npos) { |
| 70 | s.replace(pos, item.size(), replacement); |
| 71 | pos += replacement.size(); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | std::vector<std::string> split(const std::string& input, const std::string& regex) { |
| 76 | // passing -1 as the submatch index parameter performs splitting |
no test coverage detected