!1662 vcard模块,修复字符串截取与拼接问题

Merge pull request !1662 from Aurora/master
This commit is contained in:
openharmony_ci 2023-12-25 02:32:39 +00:00 committed by Gitee
commit ec238549d0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -332,9 +332,9 @@ std::string VCardUtils::TrimListToString(const std::vector<std::string> &strs)
int32_t size = static_cast<int32_t>(strs.size());
std::string result;
if (size > 1) {
std::string init = strs[VALUE_INDEX_ZERO];
std::string init = "";
result = std::accumulate(strs.begin(), strs.end(), init,
[](std::string &str, const std::string &element) { return str + ";" + element; });
[](std::string &str, const std::string &element) { return str + element + ";"; });
} else if (size == 1) {
return strs[0];
} else {