X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/3b10e39dace3cda3669de0018bb591ecfadb5ca5..46108978fb72b40c7feeb52c2a7abbd437f8751d:/lib/base/estring.cpp diff --git a/lib/base/estring.cpp b/lib/base/estring.cpp index 5d15ddce..f1d50ccc 100644 --- a/lib/base/estring.cpp +++ b/lib/base/estring.cpp @@ -633,3 +633,12 @@ void makeUpper(std::string &s) { std::transform(s.begin(), s.end(), s.begin(), (int(*)(int)) toupper); } + +std::string replace_all(const std::string &in, const std::string &entity, const std::string &symbol) +{ + std::string out = in; + std::string::size_type loc = 0; + while (( loc = out.find(entity, loc)) != std::string::npos ) + out.replace(loc, entity.length(), symbol); + return out; +}