Online Java Compiler By
JavaTpoint.com
public class CharactercodePointBeforeMethodExample2 { public static void main(String[] args) { String str = "Welcome to java tutorials."; System.out.println("Welcome to java tutorials."); // Codepoint before index 1 int res1 = str.codePointBefore(1); System.out.println( "Unicode code point before the string is " + res1 ); System.out.println("The numbers are: '1', '2', '3', '4', '5' "); char[] ch2 = new char[] { '1', '2', '3', '4', '5' }; // Codepoint before index 3. int res2 = str.codePointBefore(3); System.out.println( "Unicode code point before the number is " + res2 ); } }
Output