Add more unit tests for split string function #4933

This commit is contained in:
Jerry (Xinyu Hou)
2015-10-29 13:00:03 -07:00
parent 1b73b8875b
commit d429988e73
2 changed files with 40 additions and 6 deletions

View File

@@ -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);
}