How to count emoji in a text or string

后端 未结 4 937
渐次进展
渐次进展 2021-01-18 07:49

How to count EMOJI in a string or text line and display the output, how many emoji are in the text line or string?

For example:

4条回答
  •  攒了一身酷
    2021-01-18 08:47

    You can try this lib https://github.com/mathiasbynens/emoji-regex It provides emojiRegex. So you can match emojis in your test like this:

    const text = "Hello 

提交回复
热议问题