mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-06-19 01:14:41 +08:00
Bug fix & New function
This commit is contained in:
10
str_util.cpp
10
str_util.cpp
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user