| 1593 | } |
| 1594 | |
| 1595 | Vector<int> String::split_ints(const String& p_splitter, bool p_allow_empty) const |
| 1596 | { |
| 1597 | Vector<int> ret; |
| 1598 | int from = 0; |
| 1599 | int len = length(); |
| 1600 | |
| 1601 | while (true) |
| 1602 | { |
| 1603 | int end = find(p_splitter, from); |
| 1604 | if (end < 0) |
| 1605 | { |
| 1606 | end = len; |
| 1607 | } |
| 1608 | if (p_allow_empty || (end > from)) |
| 1609 | { |
| 1610 | ret.push_back(String::to_int(&get_data()[from], end - from)); |
| 1611 | } |
| 1612 | |
| 1613 | if (end == len) |
| 1614 | { |
| 1615 | break; |
| 1616 | } |
| 1617 | |
| 1618 | from = end + p_splitter.length(); |
| 1619 | } |
| 1620 | |
| 1621 | return ret; |
| 1622 | } |
| 1623 | |
| 1624 | Vector<int> String::split_ints_mk(const Vector<String>& p_splitters, bool p_allow_empty) const |
| 1625 | { |