If s
is a std::string
, then is there a function like the following?
s.replace(\"text to replace\", \"new text\");
Not exactly that, but std::string
has many replace overloaded functions.
Go through this link to see explanation of each, with examples as to how they're used.
Also, there are several versions of string::find functions (listed below) which you can use in conjunction with string::replace
.
Also, note that there are several versions of replace
functions available from
which you can also use (instead of string::replace
):