* Replaces every instance of a substring. * @param str The string to modify. * @param find The substring to find. * @param replace The substring to replace it with. */
| 315 | * @param replace The substring to replace it with. |
| 316 | */ |
| 317 | void Language::replace(std::string &str, const std::string &find, const std::string &replace) |
| 318 | { |
| 319 | for (size_t i = str.find(find); i != std::string::npos; i = str.find(find, i + replace.length())) |
| 320 | { |
| 321 | str.replace(i, find.length(), replace); |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | /** |
| 326 | * Replaces every instance of a substring. |
no outgoing calls
no test coverage detected