MCPcopy Create free account
hub / github.com/Samsung/UTopia / replaceStrOnce

Function replaceStrOnce

include/ftg/utils/StringUtil.h:15–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13std::string regex(std::string str, std::string regexStr, unsigned group = 0);
14
15static inline void replaceStrOnce(std::string &str, const std::string &from,
16 const std::string &to) {
17 size_t start_pos = 0;
18 if ((start_pos = str.find(from, start_pos)) != std::string::npos) {
19 str.replace(start_pos, from.length(), to);
20 }
21}
22
23static inline void replaceStrAll(std::string &str, const std::string &from,
24 const std::string &to) {

Callers 1

TESTFunction · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by 1

TESTFunction · 0.68