How can I split a string containing emoji into an array?

后端 未结 6 550
慢半拍i
慢半拍i 2020-12-01 08:12

(You\'ll need Firefox or Safari to see the emoji in the code.)

I want to take a string of emoji and do something with the individual characters.

In JavaScript

6条回答
  •  Happy的楠姐
    2020-12-01 08:41

    The modern / proper way to split a UTF8 string is using Array.from(str) instead of str.split('')

提交回复
热议问题