Esempio n. 1
0
        public static bool IsEmoji(string input)
        {
            if (input == null)
            {
                return(false);
            }
            var chars  = input.ToCharArray();
            var result = EmojiParser.GetEmojiInPosition(chars, 0);

            return(result != null && result.StartIndex == 0 && result.LastIndex == chars.Length);
        }
Esempio n. 2
0
        public static Emoji GetByUnicode(string unicode)
        {
            if (string.IsNullOrEmpty(unicode))
            {
                return(null);
            }
            var res = EmojiParser.GetEmojiInPosition(unicode.ToCharArray(), 0);

            if (res == null)
            {
                return(null);
            }
            return(res.Emoji);
        }
Esempio n. 3
0
 public static bool IsOnlyEmojis(string input) =>
 input != null && EmojiParser.RemoveAllEmojis(input) == "";
Esempio n. 4
0
 public static bool ContainsEmoji(string input) =>
 input == null ? false : EmojiParser.GetNextEmoji(input.ToCharArray(), 0) != null;