// 替换路径中所有“\”为“/” #include <algorithm> static std::string ConvertSlash(std::string& strUrl) { //size_t nLen = strlen(strPicTruePathBuff); //for (size_t i = 0 ; i < nLen; i++) //{ // if (strPicTruePathBuff[i] == ‘\\‘) // strPicTruePathBuff[i] = ‘/‘; //} std::replace(strUrl.begin(), strUrl.end(), ‘\\‘, ‘/‘); return strUrl; }
std::string 字符替换函数,布布扣,bubuko.com
原文:http://www.cnblogs.com/jingdian1956/p/3575801.html