MCPcopy Create free account
hub / github.com/comaps/comaps / ReplaceFirst

Function ReplaceFirst

libs/base/string_utils.cpp:299–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299bool ReplaceFirst(std::string & str, std::string const & from, std::string const & to)
300{
301 auto const pos = str.find(from);
302 if (pos == std::string::npos)
303 return false;
304
305 str.replace(pos, from.length(), to);
306 return true;
307}
308
309bool ReplaceLast(std::string & str, std::string const & from, std::string const & to)
310{

Callers 5

DumpPolyFilesMethod · 0.85
MakePathForWikipediaMethod · 0.85
ParseRoadShieldMethod · 0.85
ParseRoadShieldMethod · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected