| 3398 | } |
| 3399 | |
| 3400 | String String::insert(int p_at_pos, const String& p_string) const |
| 3401 | { |
| 3402 | if (p_at_pos < 0) |
| 3403 | { |
| 3404 | return *this; |
| 3405 | } |
| 3406 | |
| 3407 | if (p_at_pos > length()) |
| 3408 | { |
| 3409 | p_at_pos = length(); |
| 3410 | } |
| 3411 | |
| 3412 | String pre; |
| 3413 | if (p_at_pos > 0) |
| 3414 | { |
| 3415 | pre = substr(0, p_at_pos); |
| 3416 | } |
| 3417 | |
| 3418 | String post; |
| 3419 | if (p_at_pos < length()) |
| 3420 | { |
| 3421 | post = substr(p_at_pos, length() - p_at_pos); |
| 3422 | } |
| 3423 | |
| 3424 | return pre + p_string + post; |
| 3425 | } |
| 3426 | |
| 3427 | String String::substr(int p_from, int p_chars) const |
| 3428 | { |
no test coverage detected