| 162 | } |
| 163 | |
| 164 | std::string Join(const std::vector<std::string>& v, |
| 165 | LiteString delim, |
| 166 | uint32_t from, |
| 167 | uint32_t to) { |
| 168 | int32_t size = v.size(); |
| 169 | if (to > size) to = size; |
| 170 | if (from >= to) return ""; |
| 171 | |
| 172 | std::string s = v[from]; |
| 173 | for (int32_t idx = from + 1; idx < to; ++idx) { |
| 174 | s.append(delim.data(), delim.size()); |
| 175 | s.append(v[idx]); |
| 176 | } |
| 177 | return s; |
| 178 | } |
| 179 | |
| 180 | } // namespace strings |
| 181 | } // namespace graphlearn |