MFC VC++ Split函数的实现

 
 
void StringSplit(CString source, CStringArray& dest, char division)   
{   
	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);
			StringSplit(source,dest,division);
		}
	}
}

 

你可能感兴趣的:(split,mfc,vc++,CString)