feat(text/unstable): add trimBy functions#6778
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6778 +/- ##
==========================================
+ Coverage 94.14% 94.19% +0.05%
==========================================
Files 588 590 +2
Lines 42512 42577 +65
Branches 6701 6718 +17
==========================================
+ Hits 40022 40106 +84
+ Misses 2440 2421 -19
Partials 50 50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
How about naming these like |
Done. I also removed the option to use a scalar string as the argument, because IMO the behavior of treating it as chars is kinda confusing (even though that's what the equivalent PHP functions do). |
|
Sorry for the delay in review.
I agree with this, but how about treating |
trim functionstrimBy functions
Resolves #6265 (another attempt at abandoned #6286). Similar functionality to PHP
trim/ltrim/rtrim.String#trimfamily (notstripetc). Is this too confusing vsString#trim? Really it's the same asString#trim, just with an additional argument that can be configured (the pattern to trim).trim('aaxxbb', /[ab]/)givesxx, notaxxboraxxbb)