Bug fix & New function

This commit is contained in:
2024-04-17 14:40:45 +08:00
parent ebdb1bd55c
commit 72f6f0ab66
3 changed files with 19 additions and 2 deletions

View File

@@ -109,3 +109,13 @@ std::string str_util::str_trim(std::string input) {
}
return input;
}
std::string str_util::str_join(std::list<std::string> input, std::string pattern) {
std::string output;
for (auto i = input.begin(); i != input.end();) {
output += *i;
i++;
if (i != input.end()) output += pattern;
}
return output;
}