Java Character toCodePoint() 方法

2024 年 11 月 6 日 | 阅读 2 分钟

toCodePoint(char high, char low) 方法通常将指定的代理对转换为其补充码点值。上述方法不验证给定的代理对。如果需要,调用者需要使用 isSurrogatePair 来验证它。

语法

参数

上述方法需要两个参数

a.) 高位代理码点。

b.) 低位代理码点。

返回值

toCodePoint(char high, char low) 方法从给定的代理对返回补充码点。

示例 1

输出

The result for the above charactetr is given as:65808

示例 2

输出

The result for the above character is given as:324896
The result for the above character is given as:-624864