标签:
void split(const std::string& src, char& sq, char& ESC, StringVec& vec)
{
vec.clear();
std::string::size_type size = src.size();
std::string::size_type pos = 0, pre = 0;
for(; pos < size;pos++)
{
if(src[pos] == sq)
{
vec.push_back(substr(src, pos - pre));
pos++;
}
else if(src[pos] == ESC)
{
pos++;
}
}
if(src.empty())
{
vec.push_back(src.substr(src,pre);
}
}
标签:
原文地址:http://www.cnblogs.com/streams/p/5778117.html