• QQ
  • nahooten@sina.com
  • 常州市九洲新世界花苑15-2

技术天地

vc从字符串截取子字符串

原创内容,转载请注明原文网址:http://homeqin.cn/a/wenzhangboke/jishutiandi/2019/0724/581.html

截取子字符串,可直接使用
 
//"tian=huantian&huan";   "name="   "&"   返回"huantian"
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));
 
    
}
 

上篇:上一篇:Libcurl多线程crash问题
下篇:下一篇:VC中字符串取子串总结