Open m-mohr opened 1 month ago
Good point.
text_find
instead oftest_position
Sounds good. +1
array_find
returns null when not found instead of -1
I don't have strong preferences here. +0
rename
pattern
arg tovalue
too?
pattern is coming from text_contains, textbegins, ... I think having it consistent in text* is more important than having it consistent with array_find. -1
Edit: Updated the PR accordingly.
pattern is coming from text_contains, text_begins, ...
good point
Another thing that is worth mentioning is that the returned position is a zero-based index (as mentioned in array_find)
Isn't that captured by the description of the return value?
A value >= 0 that indicates the position of the text
If not, happy to accept proposals how to improve.
I just mentioned it because I noticed it's the first statement in the description of array_find
Returns the zero-based index of ...
while it's not explicitly mentioned in current PR of text_find
This process is pretty similar to
array_find
, so it might be good to align with that one:text_find
instead oftest_position
array_find
returns null when not found instead of -1pattern
arg tovalue
too?