| 1528 | } |
| 1529 | |
| 1530 | Vector<double> String::split_floats(const String& p_splitter, bool p_allow_empty) const |
| 1531 | { |
| 1532 | Vector<double> ret; |
| 1533 | int from = 0; |
| 1534 | int len = length(); |
| 1535 | |
| 1536 | while (true) |
| 1537 | { |
| 1538 | int end = find(p_splitter, from); |
| 1539 | if (end < 0) |
| 1540 | { |
| 1541 | end = len; |
| 1542 | } |
| 1543 | if (p_allow_empty || (end > from)) |
| 1544 | { |
| 1545 | ret.push_back(String::to_float(&get_data()[from])); |
| 1546 | } |
| 1547 | |
| 1548 | if (end == len) |
| 1549 | { |
| 1550 | break; |
| 1551 | } |
| 1552 | |
| 1553 | from = end + p_splitter.length(); |
| 1554 | } |
| 1555 | |
| 1556 | return ret; |
| 1557 | } |
| 1558 | |
| 1559 | Vector<float> String::split_floats_mk(const Vector<String>& p_splitters, bool p_allow_empty) const |
| 1560 | { |