<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>5.1.1</version>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>5.1.1</version>
</dependency>
/**
* 去除表情
*
* @param notice
* @return
*/
public static String remove64SmileStr(String notice) {
if (StringUtils.isEmpty(notice)) {
return "無(wú)";
}
try {
notice = EmojiUtil.toAlias(notice);
notice = notice.replaceAll("[\\ud800\\udc00-\\udbff\\udfff\\ud800-\\udfff]", "*");
} catch (Exception e) {
logger.error("error", e);
}
if (StringUtils.isEmpty(notice)) {
notice = "無(wú)";
}
return notice;
}