MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / str_replace_all

Function str_replace_all

tests/autotester/autotester.cpp:337–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337std::string str_replace_all(std::string str, const std::string& from, const std::string& to)
338{
339 size_t start_pos = 0;
340 while ((start_pos = str.find(from, start_pos)) != std::string::npos)
341 {
342 str.replace(start_pos, from.length(), to);
343 start_pos += to.length();
344 }
345 return str;
346}
347
348/*******************************/
349

Callers 1

loadJSONConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected