Few more bugs fixed
This commit is contained in:
@ -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;
|
||||
}
|
Reference in New Issue
Block a user