MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / replace_substring

Function replace_substring

Source/external/json.hpp:2955–2964  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2953*/
2954template<typename StringType>
2955inline void replace_substring(StringType& s, const StringType& f,
2956 const StringType& t)
2957{
2958 JSON_ASSERT(!f.empty());
2959 for (auto pos = s.find(f); // find first occurrence of f
2960 pos != StringType::npos; // make sure f was found
2961 s.replace(pos, f.size(), t), // replace with t, and
2962 pos = s.find(f, pos + t.size())) // find next occurrence of f
2963 {}
2964}
2965
2966/*!
2967 * @brief string escaping as described in RFC 6901 (Sect. 4)

Callers 2

escapeFunction · 0.85
unescapeFunction · 0.85

Calls 2

emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected