例如:
“1111 2222 3333 3333”
void JSon::Split(CString StrSource, /*CStringArray& StrArrayDest,*/ CString strDivision)
{
//StrArrayDest.RemoveAll();
int nPos = 0;
int nPre_pos = 0;
while (-1 != nPos) {
nPre_pos = nPos;
nPos = StrSource.Find(strDivision, (nPos + 1));
m_UpdataVersionInfo.vecFileName.push_back(StrSource.Mid(nPre_pos, (nPos - nPre_pos)));
}
}
CString JSon::RemoveExtraSpace(CString strSrc)
{
CString strRet;
int i = 0;
bool lastChrIsSpace = false;
for (i = 0; i < strSrc.GetLength(); i++)
{
if (strSrc[i] == ' ') {
if (lastChrIsSpace) {
continue;
}
else {
strRet.AppendChar(' ');
lastChrIsSpace = true;
}
}
else {
strRet.AppendChar(strSrc.GetAt(i));
lastChrIsSpace = false;
}
}
return strRet;
}