| 510 | } |
| 511 | |
| 512 | void BString::split(char c, std::vector<BString>& results) const { |
| 513 | if (!isEmpty()) { |
| 514 | char* s = data->str; |
| 515 | char* p = s; |
| 516 | |
| 517 | while ((p = strchr(s, c))) { |
| 518 | int startIndex = (int)(s - data->str); |
| 519 | int stopIndex = (int)(p - data->str); |
| 520 | results.push_back(this->substr(startIndex, stopIndex - startIndex)); |
| 521 | s = p + 1; |
| 522 | } |
| 523 | results.push_back(BString::copy(s)); |
| 524 | } |
| 525 | } |
| 526 | |
| 527 | void BString::split(const char* c, std::vector<BString>& results) const { |
| 528 | if (!isEmpty()) { |
no test coverage detected