angular.js - angular中是否如何判断一段文本是否包含emoji?
淡淡烟草味
淡淡烟草味 2017-05-15 17:07:23
0
2
646

在项目需要实现从服务端获取到的文本信息中把emoji换成图片展示,但是服务端返回的格式类似这种
eg:[pig_4] [pig_5] [pig_4] [pig_5] [pig_5],我应该怎么把相对应的[pig_4]换成对应的图片呢?用截取??

淡淡烟草味
淡淡烟草味

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!