| 3425 | } |
| 3426 | |
| 3427 | String String::substr(int p_from, int p_chars) const |
| 3428 | { |
| 3429 | if (p_chars == -1) |
| 3430 | { |
| 3431 | p_chars = length() - p_from; |
| 3432 | } |
| 3433 | |
| 3434 | if (is_empty() || p_from < 0 || p_from >= length() || p_chars <= 0) |
| 3435 | { |
| 3436 | return ""; |
| 3437 | } |
| 3438 | |
| 3439 | if ((p_from + p_chars) > length()) |
| 3440 | { |
| 3441 | p_chars = length() - p_from; |
| 3442 | } |
| 3443 | |
| 3444 | if (p_from == 0 && p_chars >= length()) |
| 3445 | { |
| 3446 | return String(*this); |
| 3447 | } |
| 3448 | |
| 3449 | String s; |
| 3450 | s.copy_from_unchecked(&get_data()[p_from], p_chars); |
| 3451 | return s; |
| 3452 | } |
| 3453 | |
| 3454 | int String::find(const String& p_str, int p_from) const |
| 3455 | { |
no test coverage detected