两个字符串:一:
我爱你中国
我是一个这样儿的人
快乐生活中二:
我爱你中国
我是一个这样儿的人
快乐生活中
新的生活新的开始求个方法思路,能够准确的比对出不同的字符串,并能截取出“新的生活新的开始”这部分内容。新手请大家多多指教~~~

解决方案 »

  1.   

    CString str1,str2;
    int i=str2.Find(str1);
    str2.mid(i,str2.GetLength()-i);
      

  2.   

    CString str1=L"我爱你中国我是一个这样儿的人快乐生活中";
    CString str2=L"我爱你中国我是一个这样儿的人快乐生活中新的生活新的开始";
    if(str2.Find(str1)!=-1)
    {  
     int i=str1.GetLength();
     CString str3=str2.Mid(i,str2.GetLength()-i);
    }
      

  3.   

    D:\QQ261056\QQ261056Dlg.cpp(608) : error C2228: left of '.Find' must have class/struct/union type
    D:\QQ261056\QQ261056Dlg.cpp(609) : error C2228: left of '.mid' must have class/struct/union type
    D:\QQ261056\QQ261056Dlg.cpp(609) : error C2228: left of '.GetLength' must have class/struct/union type