标签:des style class tar string art
vector<string> split(const string& src, const string& separator)
{
vector<string>dest;
string str = src;
string substring;
string::size_type start = 0, index;
do
{
index = str.find_first_of(separator,start);
if (index != string::npos)
{
substring = str.substr(start,index-start);
dest.push_back(substring);
start = str.find_first_not_of(separator,index);
if (start == string::npos) return dest;
}
}while(index != string::npos);
//the last token
substring = str.substr(start);
dest.push_back(substring);
return dest;
}
标签:des style class tar string art
原文地址:http://www.cnblogs.com/lh92lxm/p/3779442.html