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) #48449

Closed
wants to merge 4 commits into from

Conversation

moshe-autoleadstar
Copy link
Contributor

Take the first or last {$limit} characters.

Before

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

After

str('abcdef')->take(2) // 'ab'

@moshe-autoleadstar moshe-autoleadstar marked this pull request as ready for review September 19, 2023 11:56
@driesvints driesvints changed the title Add str()->take($limit) [10.x] Add str()->take($limit) Sep 19, 2023
@taylorotwell
Copy link
Member

Hey there - cool method but would have to be added to Str too.

@moshe-autoleadstar
Copy link
Contributor Author

Added! #48467

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.

None yet

2 participants