rt

解决方案 »

  1.   

    说错了 用LeftCString str,str1;
    str = _T("abcdefg.zip");
    int iPos = str.find('.');
    str1.Left(iPos+1);
      

  2.   

    先find找到你的分隔符 如 '.',然后Left截取
      

  3.   

    CString str,str1;
    str = _T("abcdefg.zip");
    int iPos = str.Find('.');
    str1 = str.Left(iPos);
      

  4.   

    用Find()找到那个‘.’的索引,然后用Left()或Right()截取,就行了
      

  5.   

    CString strfilename, strfiledata;
    strfilename = _T("abcdefg.zip"); //your file nameif(!strfilename.IsEmpty())
    {
       int iposition = strfilename.Find('.')//Searches this string for the first match 
       /*
       int iposition = strfilename.ReverseFind('.') //Searches this string for the last match 
       */
       strfiledata = strfilename.Left(iposition);
    }
      

  6.   

    CString str,str1; 
    str = _T("abcdefg.zip"); 
    int iPos = str.find('.'); 
    str1.Left(iPos+1);