MCPcopy Create free account
hub / github.com/Snapchat/Valdi / stringReplace

Function stringReplace

valdi_core/src/valdi_core/cpp/Utils/StringBox.cpp:142–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void stringReplace(std::string& input, std::string_view searchPattern, std::string_view replacement) noexcept {
143 for (;;) {
144 auto index = input.find(searchPattern);
145 if (index == std::string::npos) {
146 break;
147 }
148
149 input.replace(index, searchPattern.size(), replacement);
150 }
151}
152
153const Ref<InternedStringImpl>& StringBox::getInternedString() const noexcept {
154 return _internedString;

Callers 2

resolveSchemaStringMethod · 0.85

Calls 3

replaceMethod · 0.65
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected