File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1655,17 +1655,17 @@ The `chopEnd` method removes the last occurrence of the given value only if the
1655
1655
1656
1656
use Illuminate\Support\Str;
1657
1657
1658
- $url = Str::of('https://laravel.com')->chopEnd('https:// ');
1658
+ $url = Str::of('https://laravel.com')->chopEnd('.com ');
1659
1659
1660
- // 'laravel.com '
1660
+ // 'https:// laravel'
1661
1661
1662
1662
You may also pass an array. If the string ends with any of the values in the array then that value will be removed from string:
1663
1663
1664
1664
use Illuminate\Support\Str;
1665
1665
1666
- $url = Str::of('http://laravel.com')->chopEnd(['https:// ', 'http:// ']);
1666
+ $url = Str::of('http://laravel.com')->chopEnd(['.com ', '.io ']);
1667
1667
1668
- // 'laravel.com '
1668
+ // 'http:// laravel'
1669
1669
1670
1670
<a name =" method-fluent-str-contains " ></a >
1671
1671
#### ` contains ` {.collection-method}
You can’t perform that action at this time.
0 commit comments