StringHelpers¶
Replace¶
Internal helper function¶
static std::string Replace(const std::string str, const char find, const std::string subst)
static std::string Replace(const std::string str, const std::string find, const std::string subst)
A static helper function.
Will return str
, but with every occurrence of find
replaced by subst
.
Example:¶
C++:¶
StringHelpers::Replace("Hello, $name!", "$name", "Heinrich");
Returns:¶
Hello, Heinrich!