mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
4af2ec88bd
In an effort to convert core to C++ structures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
17 lines
366 B
C++
17 lines
366 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#include "subsurface-string.h"
|
|
|
|
std::string join(const std::vector<std::string> &l, const std::string &separator, bool skip_empty)
|
|
{
|
|
std::string res;
|
|
bool first = true;
|
|
for (const std::string &s: l) {
|
|
if (skip_empty && l.empty())
|
|
continue;
|
|
if (!first)
|
|
res += separator;
|
|
res += s;
|
|
first = false;
|
|
}
|
|
return res;
|
|
}
|