Skip to content
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

Support for string.index #14

Open
shantanu1227 opened this issue Sep 30, 2020 · 1 comment
Open

Support for string.index #14

shantanu1227 opened this issue Sep 30, 2020 · 1 comment

Comments

@shantanu1227
Copy link

Example:

 ✨💫 Hello @Test , what's up?

Now I want to find index of @Test

@alvinlindstam
Copy link
Owner

Hi @shantanu1227, good suggestion. The more feature parity with strings, the better..

So in this scenario, I'd expect it to do what str.index does, but also check that there is grapheme boundaries before and after @Test, right? And would you want the index in terms of where it starts in the string or the grapheme index?

I think that this would basically be the same logic as the contains function, but with a different return value. I think that it would make sense to transform the containes function to an index or find function, and let the contains function build a boolean result based on calling the index/find one.

PRs welcome, I might get to it but no promises..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants