| @@ 1825-1842 (lines=18) @@ | ||
| 1822 | * |
|
| 1823 | * @return static |
|
| 1824 | */ |
|
| 1825 | public function lineWrap( |
|
| 1826 | int $limit, |
|
| 1827 | string $break = "\n", |
|
| 1828 | bool $add_final_break = true, |
|
| 1829 | string $delimiter = null |
|
| 1830 | ): self { |
|
| 1831 | return static::create( |
|
| 1832 | $this->utf8::wordwrap_per_line( |
|
| 1833 | $this->str, |
|
| 1834 | $limit, |
|
| 1835 | $break, |
|
| 1836 | true, |
|
| 1837 | $add_final_break, |
|
| 1838 | $delimiter |
|
| 1839 | ), |
|
| 1840 | $this->encoding |
|
| 1841 | ); |
|
| 1842 | } |
|
| 1843 | ||
| 1844 | /** |
|
| 1845 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 1861-1878 (lines=18) @@ | ||
| 1858 | * |
|
| 1859 | * @return static |
|
| 1860 | */ |
|
| 1861 | public function lineWrapAfterWord( |
|
| 1862 | int $limit, |
|
| 1863 | string $break = "\n", |
|
| 1864 | bool $add_final_break = true, |
|
| 1865 | string $delimiter = null |
|
| 1866 | ): self { |
|
| 1867 | return static::create( |
|
| 1868 | $this->utf8::wordwrap_per_line( |
|
| 1869 | $this->str, |
|
| 1870 | $limit, |
|
| 1871 | $break, |
|
| 1872 | false, |
|
| 1873 | $add_final_break, |
|
| 1874 | $delimiter |
|
| 1875 | ), |
|
| 1876 | $this->encoding |
|
| 1877 | ); |
|
| 1878 | } |
|
| 1879 | ||
| 1880 | /** |
|
| 1881 | * Splits on newlines and carriage returns, returning an array of Stringy |
|