VC:分割字符串
时间:2011-03-10 来源:yangyh
void CTestTelnet2Dlg::Split(CString source, CStringArray &dest, CString div) { dest.RemoveAll(); CString tmp; int start = 0; int pos; do{ pos = source.Find(div,start); if(pos!=-1) tmp = source.Mid(start,pos-start); else tmp = source.Mid(start); start = pos+1; if(0!=tmp.GetLength()) dest.Add(tmp); }while(pos!=-1); }
相关阅读 更多 +