I want to know how I can do this:
- Find "sqrt" in a string
- Replace "sqrt" with only "#"
I have the following code but its not working. Why?
size_t found = 0;
found = modifiedExpr.find("sqrt");
if(found!=std::string::npos)
{
modifiedExpr.replace(modifiedExpr.find(sqrt),sqrt.length(),"#");
}