MFC

mfc 查找子串

2019-08-21  本文已影响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","找到了");
        }
}
上一篇 下一篇

猜你喜欢

热点阅读