//"henanshengname=yangzhenjiang&huashengdou"; "name=" "&" 返回"yangzhenjiang"
string FindString(const string strContent,LPCSTR szBegin,LPCSTR szEnd)
{
std::string strResult = "";
int nPos1 = strContent.find(szBegin);
cout<<"nPos1:"<<nPos1<<endl;
if(nPos1 == std::string::npos){
return strResult;
}
std::string strNew = strContent.substr(nPos1 + strlen(szBegin));
int nPos2 = strNew.find(szEnd); //获取需要截取字符串的长度
if(nPos2 == std::string::npos){
return strResult;
}
strResult = strContent.substr(nPos1 + strlen(szBegin),nPos2); // 第一个参数是截取的开始位置,第二个参数是向后截取的字符个数
return strResult;
}