MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / replaceAll

Function replaceAll

src/openms/source/FORMAT/ParamCWLFile.cpp:19–28  ·  view source on GitHub ↗

replaces the substrings inside a string This method is 'static' so no external linkage occurs

Source from the content-addressed store, hash-verified

17// replaces the substrings inside a string
18// This method is 'static' so no external linkage occurs
19static std::string replaceAll(std::string str, const std::string& pattern, const std::string& replacement)
20{
21 size_t pos {0};
22 while ((pos = str.find(pattern, pos)) != std::string::npos)
23 {
24 str.replace(pos, pattern.size(), replacement);
25 pos += replacement.size();
26 }
27 return str;
28}
29
30namespace OpenMS
31{

Callers 1

loadMethod · 0.85

Calls 3

findMethod · 0.45
replaceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected