[英]How to convert special symbol to emoji character in JavaScript?
我需要将特殊字符转换为表情符号。
let text = "This time also delivered a big product in an awesome package and fast delivery, and one more thing, this product manufactured on May 19, onlyðððð totally 5¶¶¶¶¶ starts, to this product but front is made up of some type of steel but it is not up to me, remaining is really good";
If you are adding a emoji to a text, you can directly add it in the string:如果要在文本中添加表情符号,可以直接将其添加到字符串中:
https://www.kirupa.com/html5/emoji.htm https://www.kirupa.com/html5/emoji.htm
On the other hand, if the text is a input and you wish to pickup the emoji, you can use this package :另一方面,如果文本是输入并且您希望提取表情符号,则可以使用此包:
https://github.com/iamcal/js-emoji https://github.com/iamcal/js-emoji
ES6/ES2015 introduced a way to represent Unicode points in the astral planes (any Unicode code point requiring more than 4 chars), by wrapping the code in graph parentheses: ES6/ES2015 引入了一种在星体平面中表示 Unicode 点的方法(任何需要超过 4 个字符的 Unicode 代码点),通过将代码包装在图形括号中:
Format: \\u{XXXXX}
格式:
\\u{XXXXX}
For Example:例如:
\\u{1F436}
will work and a dog emoji will appear \\u{1F436}
会起作用,并且会出现一个狗表情符号
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.