1 #ifndef S2_THIRD_PARTY_ABSL_STRINGS_STR_JOIN_H_ 2 #define S2_THIRD_PARTY_ABSL_STRINGS_STR_JOIN_H_ 3 4 #include <string> 5 6 namespace absl { 7 8 template <typename Range> StrJoin(const Range & strs,const char * delim)9std::string StrJoin(const Range& strs, const char* delim) { 10 std::string joined; 11 bool first = true; 12 for (const auto& s : strs) { 13 if (!first) joined.append(delim); 14 joined.append(s); 15 first = false; 16 } 17 return joined; 18 } 19 20 } // namespace absl 21 22 #endif // S2_THIRD_PARTY_ABSL_STRINGS_STR_JOIN_H_ 23