angular.js - How to determine whether a piece of text contains emoji in angular?
淡淡烟草味
淡淡烟草味 2017-05-15 17:07:23
0
2
689

The project needs to replace emoji with pictures in the text information obtained from the server, but the format returned by the server is similar to this
eg:[pig_4] [pig_5] [pig_4] [pig_5] [ pig_5], how should I replace the corresponding [pig_4] with the corresponding picture? Use interception? ?

淡淡烟草味
淡淡烟草味

reply all(2)
淡淡烟草味

You can use regular expressions to implement the analysis yourself
Or see if there is an emoji library, https://github.com/search?l=J...
Then make it filter(ng1)/pipe(ng2)

迷茫

It’s hard to judge, emoji strings basically all start with /, and some special characters also start with /, so if you can accurately distinguish whether they are special characters, you can judge. Regex is very simple to write!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template