二、函數(shù)代碼:
//參數(shù)說(shuō)明: source: 需要分割的源字符串; dest: 存儲(chǔ)分割后的各個(gè)字符串變量的目標(biāo)變量; 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); //去掉左邊 } } } } |