e.g str["windows98windows2000windowsxp"]我要在这个字符串中找"2000"。有函数吗?

解决方案 »

  1.   

    CString str="windows98windows2000windowsxp";
    str.Find("2000");
      

  2.   

    我不是用MFC,是用SDK提供的API来编程的...
      

  3.   

    LPTSTR StrStr(          LPCTSTR lpFirst,
        LPCTSTR lpSrch
    );
      

  4.   

    CString 有几个查找函数Find()
    FindFirstOf
    ...
      

  5.   


    你可以把把字符串复制一个临时字符串,然后用
    LPTSTR CharUpper(          LPTSTR lpsz
    );
    转换为大写,然后你从里面直接搜索大写的字串就可以了。
      

  6.   

    那就应该是LPTSTR StrStr(
        LPCTSTR lpFirst,
        LPCTSTR lpSrch
        );
      

  7.   


    LPTSTR StrStrI(          LPCTSTR lpFirst,
        LPCTSTR lpSrch
    );
    这个不区分大小写