| 297 | } |
| 298 | |
| 299 | bool ReplaceFirst(std::string & str, std::string const & from, std::string const & to) |
| 300 | { |
| 301 | auto const pos = str.find(from); |
| 302 | if (pos == std::string::npos) |
| 303 | return false; |
| 304 | |
| 305 | str.replace(pos, from.length(), to); |
| 306 | return true; |
| 307 | } |
| 308 | |
| 309 | bool ReplaceLast(std::string & str, std::string const & from, std::string const & to) |
| 310 | { |
no test coverage detected