| @@ 2154-2171 (lines=18) @@ | ||
| 2151 | * |
|
| 2152 | * @return static |
|
| 2153 | */ |
|
| 2154 | public function lineWrap( |
|
| 2155 | int $limit, |
|
| 2156 | string $break = "\n", |
|
| 2157 | bool $add_final_break = true, |
|
| 2158 | string $delimiter = null |
|
| 2159 | ): self { |
|
| 2160 | return static::create( |
|
| 2161 | $this->utf8::wordwrap_per_line( |
|
| 2162 | $this->str, |
|
| 2163 | $limit, |
|
| 2164 | $break, |
|
| 2165 | true, |
|
| 2166 | $add_final_break, |
|
| 2167 | $delimiter |
|
| 2168 | ), |
|
| 2169 | $this->encoding |
|
| 2170 | ); |
|
| 2171 | } |
|
| 2172 | ||
| 2173 | /** |
|
| 2174 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 2190-2207 (lines=18) @@ | ||
| 2187 | * |
|
| 2188 | * @return static |
|
| 2189 | */ |
|
| 2190 | public function lineWrapAfterWord( |
|
| 2191 | int $limit, |
|
| 2192 | string $break = "\n", |
|
| 2193 | bool $add_final_break = true, |
|
| 2194 | string $delimiter = null |
|
| 2195 | ): self { |
|
| 2196 | return static::create( |
|
| 2197 | $this->utf8::wordwrap_per_line( |
|
| 2198 | $this->str, |
|
| 2199 | $limit, |
|
| 2200 | $break, |
|
| 2201 | false, |
|
| 2202 | $add_final_break, |
|
| 2203 | $delimiter |
|
| 2204 | ), |
|
| 2205 | $this->encoding |
|
| 2206 | ); |
|
| 2207 | } |
|
| 2208 | ||
| 2209 | /** |
|
| 2210 | * Splits on newlines and carriage returns, returning an array of Stringy |
|