标签:class blog code 2014 string os
vector<string> strsplit(const string& str) { vector<string> vec; string sstr1=str, sstr2=""; size_t np=0; while (sstr1!="") { size_t dt = sstr1.find(','); if (dt != string::npos) { sstr1 = str.substr(np, dt); sstr2 = str.substr(np+dt+1); np += dt+1; } vec.push_back(sstr1); sstr1 = sstr2; sstr2=""; } return vec; }
标签:class blog code 2014 string os
原文地址:http://blog.csdn.net/shellching/article/details/32333815