Java StringBuilder codePointAt() Method
Example
Return the Unicode value of the first character:
StringBuilder sb = new StringBuilder("Hello");
int result = sb.codePointAt(0);
System.out.println(result);
Definition and Usage
The codePointAt() method returns the Unicode value (code point) of the character at the specified index.
Syntax
public int codePointAt(int index)
Parameter Values
| Parameter | Description |
|---|---|
| index | Required. An int value representing the index of the character. |
Technical Details
| Returns: | An int value, representing the Unicode value of the character at the index. |
|---|---|
| Throws: | IndexOutOfBoundsException - if index is negative or not less than the length. |
Related Pages
Java String codePointAt() Method
❮ StringBuilder Methods