Is it possible in C++ to replace part of a string with another string?
Basically, I would like to do this:
QString string(\"hello $name\"); string.re
This could be even better to use
void replace(string& input, const string& from, const string& to) { while(true) { size_t startPosition = input.find(from); if(startPosition == string::npos) break; input.replace(startPosition, from.length(), to); } }