Java tutorial
public class Main { 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); } }