grapheme icon indicating copy to clipboard operation
grapheme copied to clipboard

Support for string.index

Open shantanu1227 opened this issue 4 years ago • 1 comments

Example:

 ✨💫 Hello @Test , what's up?

Now I want to find index of @Test

shantanu1227 avatar Sep 30 '20 13:09 shantanu1227

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..

alvinlindstam avatar Jan 01 '21 15:01 alvinlindstam