标签:
/*将originStr字符串中的searchStr替换成replaceStr*/ std::string str_replace(std::string originStr,std::string searchStr,std::string replaceStr){ std::string::size_type pos = 0; while((pos = originStr.find(searchStr, pos)) != std::string::npos) { originStr.replace(pos, searchStr.size(), replaceStr); pos++; } return originStr; }
标签:
原文地址:http://www.cnblogs.com/xyida/p/4309534.html