17 auto pred=[](
char c){
return std::isspace(c); };
19 std::string::const_iterator left
20 =std::find_if_not(s.begin(), s.end(), pred);
26 std::string::const_reverse_iterator right
27 =std::find_if_not(s.rbegin(), s.rend(), pred);
30 return s.substr(i, (j-i+1));
36 std::vector<std::string> &result,
40 assert(result.empty());
41 assert(!std::isspace(delim));
59 std::string new_s=s.substr(start, i-start);
64 if(!remove_empty || !new_s.empty())
65 result.push_back(new_s);
71 std::string new_s=s.substr(start, n-start);
76 if(!remove_empty || !new_s.empty())
77 result.push_back(new_s);
90 assert(!std::isspace(delim));
92 std::vector<std::string> result;
96 throw "split string did not generate exactly 2 parts";
std::string strip_string(const std::string &s)
unsignedbv_typet size_type()
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)