MCPcopy Create free account
hub / github.com/Rezonality/zep / string_replace

Function string_replace

src/mcommon/string/stringutils.cpp:29–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29std::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
40void string_replace_in_place(std::string& subject, const std::string& search, const std::string& replace)
41{

Callers 2

HandleExCommandMethod · 0.85
beginMethod · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected