Mercurial > minori
diff src/string_utils.cpp @ 7:07a9095eaeed
Update
Refactored some code, moved some around
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Thu, 24 Aug 2023 23:11:38 -0400 |
parents | 190ded9438c0 |
children |
line wrap: on
line diff
--- a/src/string_utils.cpp Wed Aug 16 00:49:17 2023 -0400 +++ b/src/string_utils.cpp Thu Aug 24 23:11:38 2023 -0400 @@ -1,7 +1,8 @@ /** * string_utils.cpp: Useful functions for manipulating strings * - * Every function in here *should* have a working wstring equivalent. + * Every function in here *should* have a working wstring equivalent, + * although we don't use wstrings anymore... **/ #include <vector> #include <string> @@ -9,10 +10,10 @@ #include <locale> #include "string_utils.h" -/* It's actually pretty insane how the standard library still doesn't - have a function for this. Look at how simple this is. */ std::string StringUtils::Implode(const std::vector<std::string>& vector, const std::string& delimiter) { + if (vector.size() < 1) + return "-"; std::string out = ""; for (unsigned long long i = 0; i < vector.size(); i++) { out.append(vector.at(i));