| 172 | |
| 173 | template <class Container> |
| 174 | void split(std::string_view str, Container& cont, std::string_view delims = " ") |
| 175 | { |
| 176 | std::size_t current = str.find_first_of(delims); |
| 177 | std::size_t previous = 0; |
| 178 | while (current != std::string::npos) |
| 179 | { |
| 180 | cont.emplace_back(str.substr(previous, current - previous)); |
| 181 | previous = current + 1; |
| 182 | current = str.find_first_of(delims, previous); |
| 183 | } |
| 184 | cont.emplace_back(str.substr(previous, current - previous)); |
| 185 | } |
| 186 | |
| 187 | inline void replaceLast(std::string& str, std::string_view substr, std::string_view with) |
| 188 | { |
no outgoing calls
no test coverage detected