string& replace_all ( string& str , const string oldword, const string newword )
{
while(true )
{
string::size_type pos(0);
if( ( pos = str.find(oldword) ) != string::npos )
{
str.replace( pos, oldword.length(), newword );
}
else
{
break;
}
}
return str;
}