美文网首页MFC
mfc 查找子串

mfc 查找子串

作者: 云胡同学 | 来源:发表于2019-08-21 16:11 被阅读0次
void FindSubstring()
{
    string::size_type res;  
    string str= "123452014666";
    string findedValue = "2014"; 
    res = str.find(findedValue); // 在 str 中查找 2014.
    if (res == string::npos)//不存在
        {
            TRACE("%s\n","找不到");
        }
    else//存在
        {
            TRACE("%s\n","找到了");
        }
}

相关文章

网友评论

    本文标题:mfc 查找子串

    本文链接:https://www.haomeiwen.com/subject/htkisctx.html