| 27 | } |
| 28 | |
| 29 | std::string string_replace(std::string subject, const std::string& search, const std::string& replace) |
| 30 | { |
| 31 | size_t pos = 0; |
| 32 | while ((pos = subject.find(search, pos)) != std::string::npos) |
| 33 | { |
| 34 | subject.replace(pos, search.length(), replace); |
| 35 | pos += replace.length(); |
| 36 | } |
| 37 | return subject; |
| 38 | } |
| 39 | |
| 40 | void string_replace_in_place(std::string& subject, const std::string& search, const std::string& replace) |
| 41 | { |
no test coverage detected