TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ replace_substring()

void nlohmann::detail::replace_substring ( std::string &  s,
const std::string &  f,
const std::string &  t 
)
inline

replace all occurrences of a substring by another string

Parameters
[in,out]sthe string to manipulate; changed so that all occurrences of f are replaced with t
[in]fthe substring to replace with t
[in]tthe string to replace f
Precondition
The search string f must not be empty. This precondition is enforced with an assertion.
Since
version 2.0.0

Definition at line 2539 of file json.hpp.

2541{
2542 JSON_ASSERT(!f.empty());
2543
2544 for (auto pos = s.find(f); // find first occurrence of f
2545 pos != std::string::npos; // make sure f was found
2546 s.replace(pos, f.size(), t), // replace with t, and
2547 pos = s.find(f, pos + t.size())) // find next occurrence of f
2548 {}
2549}