java.lang.Character.isIdentifierIgnorable(char ch)%uA0确定指定的字符应被视为一个可忽略的字符在Java标识符或Unicode标识符。
下面Unicode字符都忽略了Java标识符或Unicode标识符:
-
不是空白的ISO控制字符
-
&aposu0000&apos 通过 &aposu0008&apos
-
&aposu000E&apos 通过&aposu001B&apos
-
&aposu007F&apos 通过 &aposu009F&apos
-
-
具有格式FORMAT普通类值的所有字符
声明
以下是java.lang.Character.isIdentifierIgnorable()方法的声明
public static boolean isIdentifierIgnorable(char ch)
参数
-
ch%uA0- 要测试的字符
返回值
如果字符是可忽略的控制字符,可能是一个Java或Unicode标识符的一部分此方法返回true,否则返回false。
异常
-
NA
例子
下面的例子显示lang.Character.isIdentifierIgnorable()方法的使用。
package com.yiibai import java.lang.* public class CharacterDemo { public static void main(String[] args) { // create 2 character primitives ch1, ch2 char ch1, ch2 // assign values to ch1, ch2 ch1 = &aposu0000&apos ch2 = &apos8&apos // create 2 boolean primitives b1, b2 boolean b1, b2 // assign isIdentifierIgnorable results of ch1, ch2 to b1, b2 b1 = Character.isIdentifierIgnorable(ch1) b2 = Character.isIdentifierIgnorable(ch2) String str1 = "ch1 is an ignorable control character is " + b1 String str2 = "ch2 is an ignorable control character is " + b2 // print b1, b2 values System.out.println( str1 ) System.out.println( str2 ) } }
让我们来编译和运行上面的程序,这将产生以下结果:
ch1 is an ignorable control character is true ch2 is an ignorable control character is false