如何判断字符串中,包含子字符串

如题所述

string strDec = "天网";
string strFirewall = "防火墙";
//返回-1,表是不包含子字符串
if((strSrc.find(strDec) != -1) && (strSrc.find(strFirewall) != -1)){AfxMessageBox("源字符串中包含要查找的子字符串");}else{AfxMessageBox("源字符串中No found 子字符串");}}
温馨提示:答案为网友推荐,仅供参考
相似回答