MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / ReplaceAll

Function ReplaceAll

InsightsHelpers.cpp:155–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153//-----------------------------------------------------------------------------
154
155void ReplaceAll(std::string& str, std::string_view from, std::string_view to)
156{
157 size_t start_pos = 0;
158 while((start_pos = str.find(from, start_pos)) != std::string::npos) {
159 str.replace(start_pos, from.length(), to);
160 start_pos += to.length(); // Handles case where 'to' is a substring of 'from'
161 }
162}
163//-----------------------------------------------------------------------------
164
165namespace details {

Callers 3

InsertCoroutineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected