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

emoji.length is 5 for some emojies and 2 for some #377

Open
dhananjay0610 opened this issue Nov 27, 2023 · 1 comment
Open

emoji.length is 5 for some emojies and 2 for some #377

dhananjay0610 opened this issue Nov 27, 2023 · 1 comment

Comments

@dhananjay0610
Copy link

if we print emoji.length, then it is givin output as 2 for πŸ˜ƒ but for imojis like πŸ•΅οΈ it gives 5.
Thus if we want to check if there is only 1 emoji in input box, then how can we check ,
initially we thought of checking using emoji.length

@felixfbecker
Copy link

new Intl.Segmenter({ granularity: "grapheme" }).segment() should work

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

No branches or pull requests

2 participants