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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable