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