字符串分割
void String_Split(std::string s, std::string delim, std::vector<std::string> &ans) {
std::string::size_type pos_1, pos_2 = 0;
while (pos_2 != s.npos) {
pos_1 = s.find_first_not_of(delim, pos_2);
if (pos_1 == s.npos)break;
pos_2 = s.find_first_of(delim, pos_1);
ans.push_back(s.substr(pos_1, pos_2 - pos_1));
}
}
std::vector<double> split(std::string s, char token){
std::stringstream iss(s);
std::string word;
std::vector<double> vs;
while(getline(iss,word,token)){
vs.push_back(std::atof(word.c_str()));
}
return vs;
}
bool getSubstr(std::string strin