Vector<cstring> splitcstring (CString strsource, CString ch)
{
Vector <CString> vecstring;
int iPos = 0;
CString strtmp;
strtmp = Strsource.tokenize (Ch,ipos);
while (Strtmp.trim ()! = _t (""))
{
Vecstring.push_back (strtmp);
strtmp = Strsource.tokenize (Ch,ipos);
}
return vecstring;
}vector<cstring> splitcstring (CString strsource, Char ch)
{
CString strtmp;
Vector<cstring> vecstring;
int n=-1;
N=strsource.find (CH);
while (N!=-1)
{
Strtmp=strsource.left (N)
Vecstring.push_back (strtmp);
Strsource=strsource.left (strsource.getlenth-n+1)
N=strsource.find (CH);
}
return vecstring;
}
Vector<cstring> splitcstring (CString strsource, Char ch)
{
CString strtmp;
Vector<cstring> vecstring;
int ipos=0;
while (Afxextractsubstring (strtmp,strsource,ipos,ch))
{
ipos++;
Vecstring.push_back (strtmp);
}
return vecstring;
}
Vector<cstring> splitcstring (CString strsource, Char ch)
{
Vector<cstring> vecstring;
CString Strtmp=strtok ((LPSTR) (LPCTSTR) strsource,ch);//(LPSTR) (LPCTSTR) CString to char*
while (1)
{
Strtmp=strtok (NULL,CH);
if (strtmp==_t (""))
Break
Strtmp.trimleft ();
Vecstring.push_back (strtmp);
}
}
MFC four ways to separate strings