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