| @@ 2082-2099 (lines=18) @@ | ||
| 2079 | * |
|
| 2080 | * @return static |
|
| 2081 | */ |
|
| 2082 | public function lineWrap( |
|
| 2083 | int $limit, |
|
| 2084 | string $break = "\n", |
|
| 2085 | bool $add_final_break = true, |
|
| 2086 | string $delimiter = null |
|
| 2087 | ): self { |
|
| 2088 | return static::create( |
|
| 2089 | $this->utf8::wordwrap_per_line( |
|
| 2090 | $this->str, |
|
| 2091 | $limit, |
|
| 2092 | $break, |
|
| 2093 | true, |
|
| 2094 | $add_final_break, |
|
| 2095 | $delimiter |
|
| 2096 | ), |
|
| 2097 | $this->encoding |
|
| 2098 | ); |
|
| 2099 | } |
|
| 2100 | ||
| 2101 | /** |
|
| 2102 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 2118-2135 (lines=18) @@ | ||
| 2115 | * |
|
| 2116 | * @return static |
|
| 2117 | */ |
|
| 2118 | public function lineWrapAfterWord( |
|
| 2119 | int $limit, |
|
| 2120 | string $break = "\n", |
|
| 2121 | bool $add_final_break = true, |
|
| 2122 | string $delimiter = null |
|
| 2123 | ): self { |
|
| 2124 | return static::create( |
|
| 2125 | $this->utf8::wordwrap_per_line( |
|
| 2126 | $this->str, |
|
| 2127 | $limit, |
|
| 2128 | $break, |
|
| 2129 | false, |
|
| 2130 | $add_final_break, |
|
| 2131 | $delimiter |
|
| 2132 | ), |
|
| 2133 | $this->encoding |
|
| 2134 | ); |
|
| 2135 | } |
|
| 2136 | ||
| 2137 | /** |
|
| 2138 | * Splits on newlines and carriage returns, returning an array of Stringy |
|