java_函数手册_String_1.2_codePointCount_获取指定范围文本代码点
1 package calssString; 2 3 public class codePointCount___1_4 { 4 public static void main(String[] args) { 5 String strCom = "I LIKE JAVA"; 6 int strLower = strCom.codePointCount(2,9); 7 System.out.println(strLower); 8 9 strCom = "I LIKE J爱VA"; 10 strLower = strCom.codePointCount(2,9); 11 System.out.println(strLower); 12 13 strCom = "I LIKE J1VA"; 14 strLower = strCom.codePointCount(2,9); 15 System.out.println(strLower); 16 } 17 }