Retrieve the Unicode value of the initial character in a string (e.g., the Unicode value of “H” is 72).
String |
The codePointAt() method retrieves the Unicode value of the character located at a specified index within a string. In this string, the first character’s index is 0, the second character’s index is 1, and so forth.
public
|
|
Parameter |
Description |
|
index |
An integer value that represents the index of the character you want to retrieve. |
|
Returns: |
An integer value that signifies the Unicode value of the character located at the specified index. |
|
Throws: |
IndexOutOfBoundsException occurs if the index is either negative or exceeds the length of the specified string. |
|
Java Version: |
1.5 |