Introduce helper function to join values as string

PR #20130.
This commit is contained in:
Chocobo1 2023-12-19 00:08:37 +08:00 committed by GitHub
parent 9d90141c29
commit 073ca4267c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 188 additions and 77 deletions

View file

@ -119,14 +119,3 @@ std::optional<double> Utils::String::parseDouble(const QString &string)
return std::nullopt;
}
QString Utils::String::join(const QList<QStringView> &strings, const QStringView separator)
{
if (strings.empty())
return {};
QString ret = strings[0].toString();
for (int i = 1; i < strings.count(); ++i)
ret += (separator + strings[i]);
return ret;
}