MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / Join

Function Join

Bcore/src/main/cpp/android-base/strings.h:40–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38// Joins a container of things into a single string, using the given separator.
39template <typename ContainerT, typename SeparatorT>
40std::string Join(const ContainerT& things, SeparatorT separator) {
41 if (things.empty()) {
42 return "";
43 }
44
45 std::ostringstream result;
46 result << *things.begin();
47 for (auto it = std::next(things.begin()); it != things.end(); ++it) {
48 result << separator << *it;
49 }
50 return result.str();
51}
52
53// We instantiate the common cases in strings.cpp.
54extern template std::string Join(const std::vector<std::string>&, char);

Callers

nothing calls this directly

Calls 4

emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected