Skip to content

Commit 46ad3e9

Browse files
authored
Update strings.md (#9782)
1 parent 9f36b02 commit 46ad3e9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

strings.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,17 +1655,17 @@ The `chopEnd` method removes the last occurrence of the given value only if the
16551655

16561656
use Illuminate\Support\Str;
16571657

1658-
$url = Str::of('https://laravel.com')->chopEnd('https://');
1658+
$url = Str::of('https://laravel.com')->chopEnd('.com');
16591659

1660-
// 'laravel.com'
1660+
// 'https://laravel'
16611661

16621662
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:
16631663

16641664
use Illuminate\Support\Str;
16651665

1666-
$url = Str::of('http://laravel.com')->chopEnd(['https://', 'http://']);
1666+
$url = Str::of('http://laravel.com')->chopEnd(['.com', '.io']);
16671667

1668-
// 'laravel.com'
1668+
// 'http://laravel'
16691669

16701670
<a name="method-fluent-str-contains"></a>
16711671
#### `contains` {.collection-method}

0 commit comments

Comments
 (0)