|
- //分隔字符串,并返回CStringArray
- //调用示例:Split(strCookie,array1,_T(";"));
- void CMyFun::Split(CString source, CStringArray &dest, CString division)
- {
- //dest.RemoveAll();
- //
- if (source.IsEmpty())
- {
- }
- else
- {
- int pos = source.Find(division);
- if (pos == -1)
- {
- dest.Add(source);
- }
- else
- {
- dest.Add(source.Left(pos));
- source = source.Mid(pos + 1);
- Split(source, dest, division);
- }
- }
- }
复制代码
|
|