Closed L29CtWQQV closed 5 months ago
This is unintuitive and should be fixed - thanks for reporting it. I agree that the Mojo Standard Library should match the Python implementation here. Regardless of what start
offset you pass, the caller should reasonably expect the right offset from the beginning of the string should be returned based on the found substring.
Thanks for the report! This is fixed now, and will be in the the next Mojo release.
Bug description
I noticed, that String.find using an start-index, gives the difference between the start-index and the index of the sub-string occurrence. In Python on the other hand, the index of the occurrence is returned. So I think the Mojo behavior should match the Python one.
Steps to reproduce
Python:
Mojo REPL :
System information