MCPcopy Create free account
hub / github.com/CLIUtils/CLI11 / string find_and_replace

Method string find_and_replace

include/CLI/impl/StringTools_inl.hpp:135–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135CLI11_INLINE std::string find_and_replace(std::string str, std::string from, std::string to) {
136
137 std::size_t start_pos = 0;
138
139 while((start_pos = str.find(from, start_pos)) != std::string::npos) {
140 str.replace(start_pos, from.length(), to);
141 start_pos += to.length();
142 }
143
144 return str;
145}
146
147CLI11_INLINE void remove_default_flag_values(std::string &flags) {
148 auto loc = flags.find_first_of('{', 2);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected