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

Function replaceStrAll

include/ftg/utils/StringUtil.h:23–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23static inline void replaceStrAll(std::string &str, const std::string &from,
24 const std::string &to) {
25 size_t start_pos = 0;
26 while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
27 str.replace(start_pos, from.length(), to);
28 start_pos +=
29 to.length(); // Handles case where 'to' is a substring of 'from'
30 }
31}
32
33// trim from start
34static inline std::string ltrim(std::string s) {

Callers 5

getDemangledNameFunction · 0.85
genSignatureMethod · 0.85
getValueMethod · 0.85
getNamespaceNameMethod · 0.85
TESTFunction · 0.85

Calls 2

lengthMethod · 0.80
findMethod · 0.45

Tested by 1

TESTFunction · 0.68