The java.lang.String.codePointAt() method returns the character (Unicode code point) at the specified index. The index refers to char values (Unicode code units) and ranges from 0 to length() - 1.
This method throws the IndexOutOfBoundsException - if the index argument is negative or not less than the length of this string.
public class CodePointAtExample {
public static void main(String[] args) {
String str = "javaguides";
int unicode = str.codePointAt(0);
System.out.println("the character (Unicode code point) at the specified index is :: " + unicode);
}
}
Output:
the character (Unicode code point) at the specified index is:: 106
Reference
Free Spring Boot Tutorial - 5 Hours Full Course
Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course