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

Signed-off-by: liuxiyao223 <liuxiyao223@huawei.com>
This commit is contained in:
liuxiyao223 2023-12-25 09:47:18 +08:00
parent 513f3414bd
commit bfb123969e

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 {