分割CString类型的字符串

int SplitString(const CString str, char split, CStringArray &strArray)  
{  
    strArray.RemoveAll();  
    CString strTemp = str;  
    int iIndex = 0;  
    while (1)  
    {  
        iIndex = strTemp.Find(split);  
        if(iIndex >= 0)  
        {  
            strArray.Add(strTemp.Left(iIndex));  
            strTemp = strTemp.Right(strTemp.GetLength()-iIndex-1);  
        }  
        else  
        {  
            break;  
        }  
    }  
    strArray.Add(strTemp);  
  
    return strArray.GetSize();  
} 
原文地址:https://www.cnblogs.com/zerotoinfinity/p/7728555.html