Get Emoji Count In String

前端 未结 5 1786
暗喜
暗喜 2021-01-15 17:01

I would like to find how many emojis the user has input into an EditText. If the user only enters emojis, and uses 3 or less, I want to be able to display that

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-15 17:23

    The best way for me was codePointCount method

    For example this method returns 1 if text value is "

提交回复
热议问题