mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-13 07:06:10 +08:00
Add more unit tests for split string function #4933
This commit is contained in:
@@ -232,7 +232,9 @@ splitString(String string, const char c)
|
||||
size_t head = 0;
|
||||
size_t separator = string.find(c);
|
||||
while (separator != String::npos) {
|
||||
results.push_back(string.substr(head, separator - head));
|
||||
if (head!=separator) {
|
||||
results.push_back(string.substr(head, separator - head));
|
||||
}
|
||||
head = separator + 1;
|
||||
separator = string.find(c, head);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user