How to count grapheme clusters or “perceived” emoji characters in Java

前端 未结 1 1787
北恋
北恋 2021-01-02 12:15

I\'m looking to count the number of perceived emoji characters in a provided Java string. I\'m currently using the emoji4j library, but it doesn\'t work for grapheme cluster

相关标签:
1条回答
  • 2021-01-02 12:47

    I ended up using the ICU library, which worked much better. No changes (aside from import statements) were needed from my original codeblock, as it simply provides a different implementation of BreakIterator.

    0 讨论(0)
提交回复
热议问题