-
-
Notifications
You must be signed in to change notification settings - Fork 142
feat(support): add more methods to ArrayHelper and StringHelper
#721
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
feat(support): add more methods to ArrayHelper and StringHelper
#721
Conversation
|
Great work ! |
Agree, my preference is str()->replace(at: 5, …)
I think |
|
But of course, great PR 👍 |
aa5db6f to
a4037ba
Compare
|
Ready for another review 👍 |
Oh great point! Let's do that, no problem 👍 |
|
Btw, feel free to merge when it's done, no need waiting for me again :) |
|
Ah, you already made the changes. Peeeeerfect 💪 |
|
Just updated the TODO of the |
This pull request adds many methods to
ArrayHelperandStringHelper. This is stuff I had the need for when working on an upcoming console components overhaul PR.Normally, I would send multiple PRs for each change, but there are too many. Reviewing this PR commit-by-commit might be easier.
Changes to
ArrayHelperarr(null)instanciates an empty instance instead of[null]firstandlastintsupport togetandhasflattenandflatMapChanges to
StringHelperStringHelperwithnullwill no longer crashreplaceAt, for replacing a portion of a string with another a the specified positioninsert, which inserts a string at the specified positionlimit, for truncating a stringsubstr, which proxiesmb_substrtake, which keeps only the specified amount of characterssplit, which chunks the string usingstr_splitstripTags, for stripping HTML tags in a string