int CStringTool::Replace(std::wstring& strContent, std::wstring& strReplace, std::wstring & strDest)  

{  

    while (true)  

    {  

        size_t pos = strContent.find(strReplace);  

        if (pos != std::wstring::npos)  

        {  

            WCHAR pBuf[1]={L'\0'};  

            strContent.replace(pos, strReplace.length(), pBuf, 0);  

            strContent.insert(pos, strDest);  

        }  

        else  

        {  

            break;  

        }  

    }  

    

    return 0;  

}  

 

From: http://blog.csdn.net/hellochenlian/article/details/17410133

posted on 2018-03-05 11:57  今夜太冷  阅读(1069)  评论(0)    收藏  举报