//参数说明: source: 需要分割的源字符串; dest: 存储分割后的各个字符串变量的目标变量; division:分割字符 void decodeCString(CString source, CStringArray& dest, char division) { dest.RemoveAll(); for(int i=0;i〈 source.GetLength();i++) { if(source.GetAt(i)== division) { dest.Add(source.Left(i)); //去掉右边 for(int j=0;j 〈 (dest.GetSize()-1);j++) { dest[dest.GetSize()-1] = dest[dest.GetSize()-1].Right(dest[dest.GetSize()-1].GetLength()-dest[j].GetLength()-1); //去掉左边 } } } } |