void MyTrim(std::string &s)
{
if (s.empty())
{
return ;
}
s.erase(0,s.find_first_not_of(” “));
s.erase(s.find_last_not_of(” “) + 1);
}
string& replace_all(string& str,const string& old_value,const string& new_value)
{
while(true) {
string::size_type pos(0);
if( (pos=str.find(old_value))!=string::npos)
str.replace(pos,old_value.length(),new_value);
else break;
}
return str;
}