相关疑难解决方法(0)

检测String中的字符是否是表情符号(使用Android)

就像标题所说的那样.我想知道给定的java String是否包含表情符号.

我无法使用,Character.UnicodeBlock.of(char) == Character.UnicodeBlock.EMOTICONS因为这需要API级别19.

我发现这个代码适用于iOS,但它并不适用,因为它看起来像java和objective-c以不同的方式处理代理对.

我看过的文件告诉我:

A char value, therefore, represents Basic Multilingual Plane (BMP) code points, including the surrogate code points, or code units of the UTF-16 encoding
Run Code Online (Sandbox Code Playgroud)

我不太清楚这意味着什么.这仅仅意味着他们还将BMP点作为他们的第一个数字吗?

根据维基百科,表情符号集位于0x1f600和0x1f64f之间,但我不知道如何检查char是否在该范围内.

我曾希望这样的东西可行,但事实并非如此

if (0x1f600 <= a && a <= 0x1f64f)
{
    Print.d("Unicode", "groovy!");
}
Run Code Online (Sandbox Code Playgroud)

那么我该怎么做呢?

java android emoticons

5
推荐指数
3
解决办法
4345
查看次数

标签 统计

android ×1

emoticons ×1

java ×1