| @@ 2503-2520 (lines=18) @@ | ||
| 2500 | * | |
| 2501 | * @return static | |
| 2502 | */ | |
| 2503 | public function lineWrap( | |
| 2504 | int $limit, | |
| 2505 | string $break = "\n", | |
| 2506 | bool $add_final_break = true, | |
| 2507 | string $delimiter = null | |
| 2508 |     ): self { | |
| 2509 | return static::create( | |
| 2510 | $this->utf8::wordwrap_per_line( | |
| 2511 | $this->str, | |
| 2512 | $limit, | |
| 2513 | $break, | |
| 2514 | true, | |
| 2515 | $add_final_break, | |
| 2516 | $delimiter | |
| 2517 | ), | |
| 2518 | $this->encoding | |
| 2519 | ); | |
| 2520 | } | |
| 2521 | ||
| 2522 | /** | |
| 2523 | * Line-Wrap the string after $limit, but also after the next word. | |
| @@ 2542-2559 (lines=18) @@ | ||
| 2539 | * | |
| 2540 | * @return static | |
| 2541 | */ | |
| 2542 | public function lineWrapAfterWord( | |
| 2543 | int $limit, | |
| 2544 | string $break = "\n", | |
| 2545 | bool $add_final_break = true, | |
| 2546 | string $delimiter = null | |
| 2547 |     ): self { | |
| 2548 | return static::create( | |
| 2549 | $this->utf8::wordwrap_per_line( | |
| 2550 | $this->str, | |
| 2551 | $limit, | |
| 2552 | $break, | |
| 2553 | false, | |
| 2554 | $add_final_break, | |
| 2555 | $delimiter | |
| 2556 | ), | |
| 2557 | $this->encoding | |
| 2558 | ); | |
| 2559 | } | |
| 2560 | ||
| 2561 | /** | |
| 2562 | * Splits on newlines and carriage returns, returning an array of Stringy | |