Feature/script type enhancement (#55)

This commit is contained in:
Zero Fanker 2024-06-27 12:24:51 +08:00 committed by GitHub
parent 321d0f0768
commit 9fe1849e72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1243 additions and 635 deletions

View file

@ -62,4 +62,22 @@ public:
buffer[sizeof buffer - 1] = '\0';
return buffer;
}
static inline std::vector<CString> Split(CString str, char ch = ',') {
std::vector<CString> ret;
int start = 0;
int end = 0;
while (end != -1) {
end = str.Find(ch, start);
if (end == -1) {
ret.push_back(str.Mid(start));
} else {
ret.push_back(str.Mid(start, end - start));
start = end + 1;
}
}
return ret;
}
};