Example usage for java.lang Character offsetByCodePoints

List of usage examples for java.lang Character offsetByCodePoints

Introduction

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

Prototype

public static int offsetByCodePoints(char[] a, int start, int count, int index, int codePointOffset) 

Source Link

Document

Returns the index within the given char subarray that is offset from the given index by codePointOffset code points.

Usage

From source file:Main.java

public static void main(String[] args) {
    char[] c = new char[] { 'a', 'b', 'c', 'd', 'e', 'f' };

    int start = 1;
    int count = 5;

    int res = Character.offsetByCodePoints(c, start, count, 2, 4);

    String str = "The index within the subarray of c is " + res;
    System.out.println(str);//ww w. j  a v  a  2  s.  c  o  m
}