Java Character isBmpCodePoint() 方法

6 Nov 2024 | 3 分钟阅读

Character 类的 isBmpCodePoint(int codePoint) 方法通常用于判断给定的(或指定的)Unicode 字符是否位于基本多语言平面 (BMP) 的范围内。这些指定的 codePoint 可以通过单个 char 值表示。

语法

参数

上述方法只需要一个参数

a.)需要测试的 Unicode 字符的 codePoint。

返回值

Character 类的 isBmpCodePoint(int codePoint) 方法返回布尔值,如果指定的 codePoint 介于 MIN_VALUE 和 MAX_VALUE 之间,则返回 true;否则返回 false。

示例 1

输出

The value for the first char comes to be:  true
The value for the second char comes to be: true
The value for the third char comes to be:  true
The value for the fourth char comes to be: true
The value for the fifth char comes to be:  true

示例 2

输出

The boolean value for the first codePoint is given as:  true
The boolean value for the second codePoint is given as:  true
The boolean value for the third codePoint is given as:  false

示例 3

输出

The value for the first char comes to be:  true
The value for the second char comes to be: true
The value for the third char comes to be:  true
The value for the fourth char comes to be: true
The value for the fifth char comes to be:  true