Few more bugs fixed

This commit is contained in:
2023-07-12 22:47:19 -07:00
parent 9aaaa94406
commit d4101f3446
2 changed files with 30 additions and 1 deletions

View File

@ -147,4 +147,22 @@ static inline std::string stringReplaceAll(
startPos += replace.length();
}
return newString;
}
/**
* Joins a vector of strings into a single string, using a delimiter.
*
* @param strings Vector of strings to join.
* @param delim Delimiter to join the strings with.
*/
static inline std::string stringJoin(
const std::vector<std::string> &strings,
const std::string &delim
) {
std::string result;
for(size_t i = 0; i < strings.size(); i++) {
if(i > 0) result += delim;
result += strings[i];
}
return result;
}