String.codePointBefore() Returns the unicode value of the character present before the input position of the string.
input is an integer staring from 0 ( first position )

Here are some examples with output.
String my_str="Welcome to plus2net";
System.out.println(my_str.codePointBefore(1)); // 87
System.out.println(my_str.codePointBefore(3)); // 108
System.out.println(my_str.codePointBefore(15)); // 115
If we use input as 0 (first char is at position 0), then we will get error like this

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0

Learn more about unicode values of the Chars here

All String functions


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 All rights reserved worldwide Privacy Policy Disclaimer