diff options
author | BlockMen <nmuelll@web.de> | 2014-09-28 10:10:43 +0200 |
---|---|---|
committer | BlockMen <nmuelll@web.de> | 2014-09-28 10:10:43 +0200 |
commit | 61ed56f916f71a708b56260d7cba2160e8166529 (patch) | |
tree | b60a97684319232b177d296f92fddbcea0699521 /src/util | |
parent | b75e7148c2c6ad9a602d78d7ec6356273e3a4214 (diff) | |
download | minetest-61ed56f916f71a708b56260d7cba2160e8166529.tar.gz minetest-61ed56f916f71a708b56260d7cba2160e8166529.tar.bz2 minetest-61ed56f916f71a708b56260d7cba2160e8166529.zip |
Standardize tooltip row detection
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/string.h | 10 |
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; |