Java Character.codePointCount (char[] a, int offset, int count)
Syntax
Character.codePointCount(char[] a, int offset, int count) has the following syntax.
public static int codePointCount(char[] a, int offset, int count)
Example
In the following code shows how to use Character.codePointCount(char[] a, int offset, int count) method.
// w w w.j av a 2 s. co m
public class Main {
public static void main(String[] args) {
char[] c = new char[] { 'a', 'b', 'c', 'd', 'e' };
int offset = 1, count = 3;
int res = Character.codePointCount(c, offset, count);
String str = "Number of Unicode code points is " + res;
System.out.println( str );
}
}
The code above generates the following result.