先测试下风格
20924 /**************************************
20925 [liuzhuan]
20926 **************************************/
20927 std::string m_replace(std::string strSrc, const std::string &oldStr, const std::string &newStr, int count=-1){
20928 std::string strRet=strSrc;
20929 size_t pos = 0;
20930 int l_count=0;
20931
20932 if(-1 == count){
20933 count = strRet.size();
20934 }
20935
20936 while ((pos = strRet.find(oldStr, pos)) != std::string::npos){
20937 strRet.replace(pos, oldStr.size(), newStr);
20938
20939 if(++l_count >= count)
20940 break;
20941
20942 pos += newStr.size();
20943 }
20944 return strRet;
20945 }