MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / string_replace

Function string_replace

external/zep/src/mcommon/string/stringutils.cpp:26–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 }
25
26 std::string string_replace(std::string subject, const std::string& search, const std::string& replace) {
27 size_t pos = 0;
28 while ((pos = subject.find(search, pos)) != std::string::npos) {
29 subject.replace(pos, search.length(), replace);
30 pos += replace.length();
31 }
32 return subject;
33 }
34
35 void string_replace_in_place(std::string& subject, const std::string& search, const std::string& replace) {
36 size_t pos = 0;

Callers 1

HandleExCommandMethod · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected