[JAVA] isSurrogate(char) 与 isSupplementaryCodePoint(int)

直接上代码:

String o = new String("𝕆");
String a = "ab"; 

println(Character.isSurrogate(o.charAt(0)));// true println(Character.isSurrogate(o.charAt(1)));// true 

println(Character.isSurrogate(a.charAt(0)));// false println(Character.isSurrogate(a.charAt(1)));// false 

println(Character.isSupplementaryCodePoint(o.codePointAt(0)));// true println(Character.isSupplementaryCodePoint(o.codePointAt(1)));// false 

println(Character.isSupplementaryCodePoint(a.codePointAt(0)));// false println(Character.isSupplementaryCodePoint(a.codePointAt(1)));// false
继续阅读[JAVA] isSurrogate(char) 与 isSupplementaryCodePoint(int)