//*************************************
// 函 数 名: Split
// 功能描述: 用指定字符串分割字符串
// 参 数: string strVal 需要分割的字符串,string strDelims 分割标记字符串
// 返 回 值: vector<string> 按分割符分割后的容器
//*************************************
vector<string> Split(string strVal,string strDelims)
{
string::size_type pos;
vector<string> result;
//扩展字符串以方便操作
strVal += strDelims;
int iSize = strVal.size();
for(int i = 0; i < iSize; i++)
{
pos = strVal.find(strDelims,i);
if( pos < iSize )
{
string strSubVal = strVal.substr(i,pos-i);
result.push_back(strSubVal);
i = pos + strDelims.size()-1;
}
}
return result;
};