Here you can find the source of filterEmoji(String source)
public static String filterEmoji(String source)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static String filterEmoji(String source) { if (source != null) { Pattern emoji = Pattern.compile("[\\x{10000}-\\x{10FFFF}]", Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE); Matcher emojiMatcher = emoji.matcher(source); if (emojiMatcher.find()) { source = emojiMatcher.replaceAll("[emoji]"); return source; }/*from w w w. j a v a 2 s. co m*/ return source; } return source; } }