其中str1是要分割的字符串,str2是用来分割的字符串。
CString* GetStr(CString str1, CString str2, int &num) { int long1=str1.GetLength(); int long2=str2.GetLength(); int sign=0; char*ch2=new char[long1]; char*ch3=new char[long2]; strcpy(ch2,str1); strcpy(ch3,str2); int i=0,j=0; while(1) { if(j==long1)break; if(ch2[j]==ch3[i]) { ++j; ++i; ++sign; if(sign==long2) { i=0; sign=0; ++num; } } else { j++; sign=0; } } num++; //num++; i=0; j=0; sign=0; CString*str=new CString[num]; int begin=0,end=0; int n=0; while(1) { if(j==long1) { //n++; for(int k=begin;k