| 81 | } |
| 82 | |
| 83 | std::string join(const std::vector<std::string> &s, const char* delim) { |
| 84 | std::ostringstream imploded; |
| 85 | std::copy(s.begin(), s.end(), std::ostream_iterator<std::string>(imploded, delim)); |
| 86 | std::string ret = imploded.str(); |
| 87 | if (ret.length()) { |
| 88 | ret.resize(ret.length() - strlen(delim)); |
| 89 | } |
| 90 | return ret; |
| 91 | } |
| 92 | |
| 93 | std::string trim(const std::string &s) { |
| 94 | size_t first = s.find_first_not_of(' '); |
no outgoing calls
no test coverage detected