//将整数字符串按照特定字符拆分成字符串数组
//example 输入:"1,4,3,110,2,90,7" 输出 "1","4","3","110","2","90","7"
void split(string& strInput, char chsymbol, vector<string>& vecSplit)
{
string::size_type startPos = 0;
string::size_type endPos = string::npos;
while ((endPos = strInput.find(chsymbol, startPos)) != string::npos)
{
vecSplit.push_back(strInput.substr(startPos, endPos - startPos));
startPos = endPos + 1;
}
vecSplit.push_back(strInput.substr(startPos));
}
C++函数
最新推荐文章于 2023-03-18 20:57:33 发布