Skip to content

Commit 510dd2e

Browse files
authored
[11.x] Fix fluent methods order (alphabetical) (laravel#9891)
* [11.x] Fix fluent methods order (alphabetical) * Also fix order in method list
1 parent 02dc4b6 commit 510dd2e

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

strings.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ Laravel includes a variety of functions for manipulating string values. Many of
143143
[containsAll](#method-fluent-str-contains-all)
144144
[dirname](#method-fluent-str-dirname)
145145
[endsWith](#method-fluent-str-ends-with)
146-
[excerpt](#method-fluent-str-excerpt)
147146
[exactly](#method-fluent-str-exactly)
147+
[excerpt](#method-fluent-str-excerpt)
148148
[explode](#method-fluent-str-explode)
149149
[finish](#method-fluent-str-finish)
150150
[headline](#method-fluent-str-headline)
@@ -1763,32 +1763,6 @@ If necessary, you may specify how many directory levels you wish to trim from th
17631763

17641764
// '/foo'
17651765

1766-
<a name="method-fluent-str-excerpt"></a>
1767-
#### `excerpt` {.collection-method}
1768-
1769-
The `excerpt` method extracts an excerpt from the string that matches the first instance of a phrase within that string:
1770-
1771-
use Illuminate\Support\Str;
1772-
1773-
$excerpt = Str::of('This is my name')->excerpt('my', [
1774-
'radius' => 3
1775-
]);
1776-
1777-
// '...is my na...'
1778-
1779-
The `radius` option, which defaults to `100`, allows you to define the number of characters that should appear on each side of the truncated string.
1780-
1781-
In addition, you may use the `omission` option to change the string that will be prepended and appended to the truncated string:
1782-
1783-
use Illuminate\Support\Str;
1784-
1785-
$excerpt = Str::of('This is my name')->excerpt('name', [
1786-
'radius' => 3,
1787-
'omission' => '(...) '
1788-
]);
1789-
1790-
// '(...) my name'
1791-
17921766
<a name="method-fluent-str-ends-with"></a>
17931767
#### `endsWith` {.collection-method}
17941768

@@ -1823,6 +1797,32 @@ The `exactly` method determines if the given string is an exact match with anoth
18231797

18241798
// true
18251799

1800+
<a name="method-fluent-str-excerpt"></a>
1801+
#### `excerpt` {.collection-method}
1802+
1803+
The `excerpt` method extracts an excerpt from the string that matches the first instance of a phrase within that string:
1804+
1805+
use Illuminate\Support\Str;
1806+
1807+
$excerpt = Str::of('This is my name')->excerpt('my', [
1808+
'radius' => 3
1809+
]);
1810+
1811+
// '...is my na...'
1812+
1813+
The `radius` option, which defaults to `100`, allows you to define the number of characters that should appear on each side of the truncated string.
1814+
1815+
In addition, you may use the `omission` option to change the string that will be prepended and appended to the truncated string:
1816+
1817+
use Illuminate\Support\Str;
1818+
1819+
$excerpt = Str::of('This is my name')->excerpt('name', [
1820+
'radius' => 3,
1821+
'omission' => '(...) '
1822+
]);
1823+
1824+
// '(...) my name'
1825+
18261826
<a name="method-fluent-str-explode"></a>
18271827
#### `explode` {.collection-method}
18281828

0 commit comments

Comments
 (0)