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

[7.x] Added new Stringable::leftTrim() and Stringable::rightTrim() methods #32288

Merged
merged 2 commits into from
Apr 8, 2020
Merged

[7.x] Added new Stringable::leftTrim() and Stringable::rightTrim() methods #32288

merged 2 commits into from
Apr 8, 2020

Conversation

ryangjchandler
Copy link
Contributor

A trim() method already existed, but the neighbouring leftTrim() and rightTrim() methods were missing.

If they're not wanted in the framework, I can always macro them in but I think there would be quite a few use cases where you only want to trim from one end of the string, not both.

@taylorotwell
Copy link
Member

I would name them ltrim and rtrim to match the PHP functions. We already do something similar with ucfirst.

@ryangjchandler
Copy link
Contributor Author

@taylorotwell All done 🙂

@taylorotwell taylorotwell merged commit 4dd5501 into laravel:7.x Apr 8, 2020
@ryangjchandler ryangjchandler deleted the feature/stringable-side-trim branch April 8, 2020 19:39
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