List of utility methods to do Emoji Check
String | emoji(int hexEmoji) emoji return String.valueOf(Character.toChars(hexEmoji));
|
String | emoji(String emoji) Add emoji to text return "<ss type=\"" + emoji.replace("(", "").replace(")", "") + "\">" + emoji + "</ss>"; |
String | filterEmoji(String source) filter Emoji 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; return source; return source; |
boolean | isEmoji(char c) is Emoji if (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.PRIVATE_USE_AREA) { return true; } else { return false; |
String | resolveToEmoji(String str) resolve To Emoji str = str.replaceAll("<:", "").replaceAll(":>", ""); String[] s = str.split(","); byte[] b = new byte[s.length]; for (int i = 0; i < s.length; i++) { b[i] = Byte.valueOf(s[i]); return new String(b); |
String | resolveToEmojiFromByte(String str) resolve To Emoji From Byte Pattern pattern2 = Pattern.compile("<:([[-]\\d*[,]]+):>"); Matcher matcher2 = pattern2.matcher(str); StringBuffer sb3 = new StringBuffer(); while (matcher2.find()) { matcher2.appendReplacement(sb3, resolveToEmoji(matcher2.group(0))); matcher2.appendTail(sb3); return sb3.toString(); ... |