Skip to content

Conversation

m-mohr
Copy link
Member

@m-mohr m-mohr commented May 17, 2024

No description provided.

@soxofaan
Copy link
Member

This process is pretty similar to array_find, so it might be good to align with that one:

  • text_find instead of test_position
  • array_find returns null when not found instead of -1
  • rename pattern arg to value too?

@m-mohr
Copy link
Member Author

m-mohr commented May 29, 2024

Good point.

text_find instead of test_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 to value too?

pattern is coming from text_contains, text_begins, ...
I think having it consistent in text_* is more important than having it consistent with array_find. -1

Edit: Updated the PR accordingly.

@soxofaan
Copy link
Member

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)

@m-mohr
Copy link
Member Author

m-mohr commented May 30, 2024

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.

@soxofaan
Copy link
Member

soxofaan commented Jun 3, 2024

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

@m-mohr
Copy link
Member Author

m-mohr commented Jul 16, 2025

Updated PR to be aligned with the draft branch.

Copy link
Member

@soxofaan soxofaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor fix suggested, but fine to merge apart from that

m-mohr and others added 2 commits August 7, 2025 21:37
Co-authored-by: Stefaan Lippens <soxofaan@users.noreply.github.com>
@m-mohr m-mohr merged commit 083c227 into draft Aug 7, 2025
2 checks passed
@m-mohr m-mohr deleted the text_position branch August 7, 2025 19:39
@m-mohr m-mohr added this to the 2.0.0-rc.2 milestone Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants