Function string_replace (o2scl)

O2scl : Function List

size_t o2scl::string_replace(std::string &s, const std::string &s1, const std::string &s2)

In string s, replace all occurrences of s1 with string s2, and return the number of replacements.

Note

If the string s1 can be found inside s2, then this would lead to an infinite loop, so the error handler is called.