Java Utililty Methods Emoji Check

List of utility methods to do Emoji Check

Description

The list of methods to do Emoji Check are organized into topic(s).

Method

Stringemoji(int hexEmoji)
emoji
return String.valueOf(Character.toChars(hexEmoji));
Stringemoji(String emoji)
Add emoji to text
return "<ss type=\"" + emoji.replace("(", "").replace(")", "") + "\">" + emoji + "</ss>";
StringfilterEmoji(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;
booleanisEmoji(char c)
is Emoji
if (Character.UnicodeBlock.of(c) == Character.UnicodeBlock.PRIVATE_USE_AREA) {
    return true;
} else {
    return false;
StringresolveToEmoji(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);
StringresolveToEmojiFromByte(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();
...