| 42 | } |
| 43 | |
| 44 | std::vector<std::string> split (std::string const& s, std::string const& sep) |
| 45 | { |
| 46 | std::vector<std::string> result; |
| 47 | std::size_t pos_begin, pos_end = 0; |
| 48 | while ((pos_begin = s.find_first_not_of(sep,pos_end)) != std::string::npos) { |
| 49 | pos_end = s.find_first_of(sep,pos_begin); |
| 50 | result.push_back(s.substr(pos_begin,pos_end-pos_begin)); |
| 51 | if (pos_end == std::string::npos) { break; } |
| 52 | } |
| 53 | return result; |
| 54 | } |
| 55 | |
| 56 | std::string join (std::vector<std::string> const& sv, char sep) |
| 57 | { |
no test coverage detected