grapheme
grapheme copied to clipboard
Support for string.index
Example:
✨💫 Hello @Test , what's up?
Now I want to find index of @Test
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..