Java Data Type Tutorial - Java Character.codePointBefore (char[] a, int index)








Syntax

Character.codePointBefore(char[] a, int index) has the following syntax.

public static int codePointBefore(char[] a,   int index)

Example

In the following code shows how to use Character.codePointBefore(char[] a, int index) method.

public class Main {
/*  ww w  .  j  a va 2s.  co m*/
   public static void main(String[] args) {
      char[] c = new char[] { 'j', 'b', 'c', 'd', 'e' };
      int index  = 2;

      int res = Character.codePointBefore(c, index);

      String str = "Unicode code point is " + res;

      System.out.println( str );
   }
}

The code above generates the following result.