MCPcopy Create free account
hub / github.com/cginternals/globjects / replaceAll

Function replaceAll

source/globjects/source/base/StringTemplate.cpp:12–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12void replaceAll(
13 std::string & subject
14, const std::string & search
15, const std::string & replace)
16{
17 size_t pos = 0;
18
19 while((pos = subject.find(search, pos)) != std::string::npos)
20 {
21 subject.replace(pos, search.length(), replace);
22 pos += replace.length();
23 }
24}
25
26
27} // namespace

Callers 1

modifiedSourceMethod · 0.85

Calls 2

replaceMethod · 0.80
lengthMethod · 0.80

Tested by

no test coverage detected