Online Java Compiler By
JavaTpoint.com
public class JavaCharacteroffsetByCodePointsExample_1 { public static void main(String[] args) { // Initialize a new CharSequence object. CharSequence charseq = "This is my first string!"; // Initialize beginIndex and codePointOffset int Index = 0; int codePointOffset = charseq.length(); // Get the index within the given char sequence. int result = Character.offsetByCodePoints(charseq,Index, codePointOffset); System.out.println("The result for the above method can be represented as:" + result); } }
Output