| 47 | */ |
| 48 | template <typename T = std::string> |
| 49 | std::string Join(const std::vector<T>& fields, const std::string& splitter) { |
| 50 | if (fields.empty()) return ""; |
| 51 | std::stringstream ss; |
| 52 | for (int i = 0; i < fields.size() - 1; i++) ss << fields[i] << splitter; |
| 53 | ss << fields.back(); |
| 54 | return ss.str(); |
| 55 | } |
| 56 | |
| 57 | std::vector<std::string> Split(const std::string& str, |
| 58 | const std::string& splitter); |
no test coverage detected