| @@ 2133-2150 (lines=18) @@ | ||
| 2130 | * |
|
| 2131 | * @return static |
|
| 2132 | */ |
|
| 2133 | public function lineWrap( |
|
| 2134 | int $limit, |
|
| 2135 | string $break = "\n", |
|
| 2136 | bool $add_final_break = true, |
|
| 2137 | string $delimiter = null |
|
| 2138 | ): self { |
|
| 2139 | return static::create( |
|
| 2140 | $this->utf8::wordwrap_per_line( |
|
| 2141 | $this->str, |
|
| 2142 | $limit, |
|
| 2143 | $break, |
|
| 2144 | true, |
|
| 2145 | $add_final_break, |
|
| 2146 | $delimiter |
|
| 2147 | ), |
|
| 2148 | $this->encoding |
|
| 2149 | ); |
|
| 2150 | } |
|
| 2151 | ||
| 2152 | /** |
|
| 2153 | * Line-Wrap the string after $limit, but also after the next word. |
|
| @@ 2169-2186 (lines=18) @@ | ||
| 2166 | * |
|
| 2167 | * @return static |
|
| 2168 | */ |
|
| 2169 | public function lineWrapAfterWord( |
|
| 2170 | int $limit, |
|
| 2171 | string $break = "\n", |
|
| 2172 | bool $add_final_break = true, |
|
| 2173 | string $delimiter = null |
|
| 2174 | ): self { |
|
| 2175 | return static::create( |
|
| 2176 | $this->utf8::wordwrap_per_line( |
|
| 2177 | $this->str, |
|
| 2178 | $limit, |
|
| 2179 | $break, |
|
| 2180 | false, |
|
| 2181 | $add_final_break, |
|
| 2182 | $delimiter |
|
| 2183 | ), |
|
| 2184 | $this->encoding |
|
| 2185 | ); |
|
| 2186 | } |
|
| 2187 | ||
| 2188 | /** |
|
| 2189 | * Splits on newlines and carriage returns, returning an array of Stringy |
|