2016年11月7日 星期一

[C++][CString]Mid, Find

int nIndex = 0;

CString resToken;

 

int pos1=0,pos2=0; 

CString sFind = ",";

CString sTmp;

pos2 = strLine.Find(",",pos1); 

 

while (pos2> -1){

        sArrID[nIndex] = strLine.Mid(pos1,pos2-pos1);

        nIndex++;

        if ( nIndex == 3) sFind = ":";

        pos1 = pos2 + 1;

 

 

        pos2 = strLine.Find(sFind ,pos1); 

        if (pos2==-1) break;

}

 

Best Wishes, Lion

 

**********************Confidentiality Notice************************
The opinions and views expressed in this e-mail are solely those of the author and do not necessarily represent our company and its affiliates. If this e-mail is not originally intended for you, or received by you in error, do not disclose its content to anyone and delete it immediately. This e-mail may contain information that is legally privileged, confidential or exempt from disclosure.

沒有留言:

張貼留言