aboutsummaryrefslogtreecommitdiff
path: root/src/util/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/string.h')
-rw-r--r--src/util/string.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/string.h b/src/util/string.h
index 98d23b161..54a5a458e 100644
--- a/src/util/string.h
+++ b/src/util/string.h
@@ -113,6 +113,16 @@ inline std::vector<std::wstring> str_split(const std::wstring &str, wchar_t deli
return parts;
}
+inline std::vector<std::string> str_split(const std::string &str, char delimiter) {
+
+ std::vector<std::string> parts;
+ std::stringstream sstr(str);
+ std::string part;
+ while(std::getline(sstr, part, delimiter))
+ parts.push_back(part);
+ return parts;
+}
+
inline std::string lowercase(const std::string &s)
{
std::string s2;