-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Implement StringHelper::findBetween Method #20034
Implement StringHelper::findBetween Method #20034
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20034 +/- ##
==========================================
+ Coverage 48.00% 48.01% +0.01%
==========================================
Files 445 445
Lines 43887 43896 +9
==========================================
+ Hits 21069 21078 +9
Misses 22818 22818
☔ View full report in Codecov by Sentry. |
Do we need it? I don't have a strong opinion here. |
@bizley I don't think it is necessary but since it is addition in the helper, I do not see any issue at all! |
ebf9e1a
to
5fe844c
Compare
Is there an advantage of this function over a regular expression? |
Isn't it much simpler to use? |
Not using regular expression is already an advantage. :D BTW: I often implement similar helper, so IMO it is definitely useful. |
426c108
to
5e8321e
Compare
Could you also port it to https://github.com/yiisoft/strings/blob/master/src/StringHelper.php? |
Please add a changelog line, thanks. |
5e8321e
to
26032ad
Compare
Done |
Implement the
findBetween
method in theStringHelper
class.This method retrieves a substring that lies between the first occurrence of a specified start string and the last occurrence of a specified end string in the input string.
Tests are included.
Usage