VOID CStringFilter::ReplaceToSign_New(const STRING& strIn, STRING& strOut) { static STRING strSign = "~$%^&(){}`-_+=?,.<>"; strOut = strIn; STRING::size_type allsize = m_vIncluce.size(); //包含替换 for(STRING::size_type i = 0; i < m_vIncluce.size(); ++i) { STRING::size_type pos = strIn.find(m_vIncluce[i]); while(STRING::npos != pos) { STRING strReplace = ""; STRING::size_type len = m_vIncluce[i].size(); for(STRING::size_type k = 0; k < len; ++k) { STRING::size_type ri = rand()%int(strSign.size()); strReplace += strSign.at(ri); } strOut.replace(pos, len, strReplace); pos = strIn.find(m_vIncluce[i], pos+len); } } //完全匹配替换 if(IsFullCmp(strIn)) { STRING::size_type len = strIn.size(); strOut.clear(); for(STRING::size_type i = 0; i < len; ++i) { STRING::size_type ri = rand()%int(strSign.size()); strOut += strSign.at(ri); } } }