| @@ 2636-2653 (lines=18) @@ | ||
| 2633 | * |
|
| 2634 | * @return static |
|
| 2635 | */ |
|
| 2636 | public function lineWrap( |
|
| 2637 | int $limit, |
|
| 2638 | string $break = "\n", |
|
| 2639 | bool $add_final_break = true, |
|
| 2640 | string $delimiter = null |
|
| 2641 | ): self { |
|
| 2642 | return static::create( |
|
| 2643 | $this->utf8::wordwrap_per_line( |
|
| 2644 | $this->str, |
|
| 2645 | $limit, |
|
| 2646 | $break, |
|
| 2647 | true, |
|
| 2648 | $add_final_break, |
|
| 2649 | $delimiter |
|
| 2650 | ), |
|
| 2651 | $this->encoding |
|
| 2652 | ); |
|
| 2653 | } |
|
| 2654 | ||
| 2655 | /** |
|
| 2656 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 2675-2692 (lines=18) @@ | ||
| 2672 | * |
|
| 2673 | * @return static |
|
| 2674 | */ |
|
| 2675 | public function lineWrapAfterWord( |
|
| 2676 | int $limit, |
|
| 2677 | string $break = "\n", |
|
| 2678 | bool $add_final_break = true, |
|
| 2679 | string $delimiter = null |
|
| 2680 | ): self { |
|
| 2681 | return static::create( |
|
| 2682 | $this->utf8::wordwrap_per_line( |
|
| 2683 | $this->str, |
|
| 2684 | $limit, |
|
| 2685 | $break, |
|
| 2686 | false, |
|
| 2687 | $add_final_break, |
|
| 2688 | $delimiter |
|
| 2689 | ), |
|
| 2690 | $this->encoding |
|
| 2691 | ); |
|
| 2692 | } |
|
| 2693 | ||
| 2694 | /** |
|
| 2695 | * Splits on newlines and carriage returns, returning an array of Stringy |
|