@@ 2003-2020 (lines=18) @@ | ||
2000 | * |
|
2001 | * @return static |
|
2002 | */ |
|
2003 | public function lineWrap( |
|
2004 | int $limit, |
|
2005 | string $break = "\n", |
|
2006 | bool $add_final_break = true, |
|
2007 | string $delimiter = null |
|
2008 | ): self { |
|
2009 | return static::create( |
|
2010 | $this->utf8::wordwrap_per_line( |
|
2011 | $this->str, |
|
2012 | $limit, |
|
2013 | $break, |
|
2014 | true, |
|
2015 | $add_final_break, |
|
2016 | $delimiter |
|
2017 | ), |
|
2018 | $this->encoding |
|
2019 | ); |
|
2020 | } |
|
2021 | ||
2022 | /** |
|
2023 | * Line-Wrap the string after $limit, but also after the next word. |
|
@@ 2039-2056 (lines=18) @@ | ||
2036 | * |
|
2037 | * @return static |
|
2038 | */ |
|
2039 | public function lineWrapAfterWord( |
|
2040 | int $limit, |
|
2041 | string $break = "\n", |
|
2042 | bool $add_final_break = true, |
|
2043 | string $delimiter = null |
|
2044 | ): self { |
|
2045 | return static::create( |
|
2046 | $this->utf8::wordwrap_per_line( |
|
2047 | $this->str, |
|
2048 | $limit, |
|
2049 | $break, |
|
2050 | false, |
|
2051 | $add_final_break, |
|
2052 | $delimiter |
|
2053 | ), |
|
2054 | $this->encoding |
|
2055 | ); |
|
2056 | } |
|
2057 | ||
2058 | /** |
|
2059 | * Splits on newlines and carriage returns, returning an array of Stringy |