Java StringBuilder appendCodePoint() Method
Example
Add the letter "A" to the end, by using its Unicode value:
StringBuilder sb = new StringBuilder("Letter: ");
sb.appendCodePoint(65);
System.out.println(sb);
Definition and Usage
The appendCodePoint() method adds the character with the specified Unicode value (code point) to the end of a StringBuilder.
Syntax
public StringBuilder appendCodePoint(int codePoint)
Parameter Values
| Parameter | Description |
|---|---|
| codePoint | Required. An int value representing the Unicode value of the character to add. For example, 65 is "A". |
Technical Details
| Returns: | The same StringBuilder, with the character added to the end. |
|---|---|
| Throws: | IllegalArgumentException - if codePoint is not a valid Unicode value. |
Related Pages
❮ StringBuilder Methods