首页 > 解决方案 > 如何在 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";

标签: javascript

解决方案


如果要在文本中添加表情符号,可以直接将其添加到字符串中:

https://www.kirupa.com/html5/emoji.htm

另一方面,如果文本是输入并且您希望获取表情符号,则可以使用此包:

https://github.com/iamcal/js-emoji


推荐阅读