MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / Join

Function Join

src/UTF8Util.hpp:330–342  ·  view source on GitHub ↗

* Joins a std::string vector in to a std::string with a separator. */

Source from the content-addressed store, hash-verified

328 * Joins a std::string vector in to a std::string with a separator.
329 */
330 static std::string Join(const std::vector<std::string>& strings,
331 const std::string& separator) {
332 std::ostringstream buffer;
333 bool first = true;
334 for (const auto& str : strings) {
335 if (!first) {
336 buffer << separator;
337 }
338 buffer << str;
339 first = false;
340 }
341 return buffer.str();
342 }
343
344 /**
345 * Joins a std::string vector in to a std::string.

Callers 2

~ThreadWithParamBaseMethod · 0.50
~ThreadWithParamMethod · 0.50

Calls 1

strMethod · 0.45

Tested by 2

~ThreadWithParamBaseMethod · 0.40
~ThreadWithParamMethod · 0.40