| 153 | //----------------------------------------------------------------------------- |
| 154 | |
| 155 | void ReplaceAll(std::string& str, std::string_view from, std::string_view to) |
| 156 | { |
| 157 | size_t start_pos = 0; |
| 158 | while((start_pos = str.find(from, start_pos)) != std::string::npos) { |
| 159 | str.replace(start_pos, from.length(), to); |
| 160 | start_pos += to.length(); // Handles case where 'to' is a substring of 'from' |
| 161 | } |
| 162 | } |
| 163 | //----------------------------------------------------------------------------- |
| 164 | |
| 165 | namespace details { |
no outgoing calls
no test coverage detected