Java Character isISOControl() 方法

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

Character 类的 isISOControl(int codePoint) 方法通常用于确定所引用的字符是否为 ISO 控制字符。

如果给定字符的代码位于 '\u000' 到 '\u001F' 的范围,或者位于 '\u007F' 到 '\u009F' 的范围,则该字符可被视为 ISO 控制字符。

语法

参数

codePoint:需要测试的字符的 codePoint。

返回值

isISOControl(int codePoint) 方法返回一个布尔值,即如果给定(或指定的)字符是 ISO 控制字符,则返回 true。否则,该方法返回 false。

示例 1

输出

The first codepoint '28' is an ISO Control: true
The second codepoint '13480' is an ISO Control: false
The third codepoint '13542' is  an ISO Control: false

示例 2

输出

Enter the first input:@
The character @ is not an ISO control character:
Enter the second input:A
The character A is not an ISO control character: