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