Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Add str()->take($limit) and Str::take($string, $limit) #48467

Merged
merged 5 commits into from
Sep 20, 2023

Conversation

moshe-autoleadstar
Copy link
Contributor

Take the first or last {$limit} characters.

Before

str('abcdef')->substr(0, 2) // 'ab'
Str::substr('abcdef', 0, 2); // 'ab'

After

str('abcdef')->take(2) // 'ab'
Str::take('abcdef', 2); // 'ab'

@taylorotwell taylorotwell merged commit 9e1c516 into laravel:10.x Sep 20, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants