Example usage for java.lang Character codePointBefore

List of usage examples for java.lang Character codePointBefore

Introduction

In this page you can find the example usage for java.lang Character codePointBefore.

Prototype

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

Source Link

Document

Returns the code point preceding the given index of the char array.

Usage

From source file:Main.java

public static void main(String[] args) {
    CharSequence seq = "Hello";
    int index = 4;

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

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

    System.out.println(str);//ww  w  .  jav  a 2  s .  c  om
}

From source file:Main.java

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);//from w  w w  .  j av a2 s  .c  o m
}