-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(support): add more methods to ArrayHelper
and StringHelper
#721
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
ArrayHelper
andStringHelper
. 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
ArrayHelper
arr(null)
instanciates an empty instance instead of[null]
first
andlast
int
support toget
andhas
flatten
andflatMap
Changes to
StringHelper
StringHelper
withnull
will 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_substr
take
, which keeps only the specified amount of characterssplit
, which chunks the string usingstr_split
stripTags
, for stripping HTML tags in a string