String.char_code_at
String.char_code_at
Function
Reads the Unicode code point at the specified character position.
Syntax
string.char_code_at(index)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| index | Int | No | 0 | Character subscript, negative numbers will be treated as 0. |
Return value
| Type | Description |
|---|---|
| Int/Empty | Returns the code point integer if the subscript exists; returns Empty if out of bounds. |
Example
text = 'A' result = text.char_code_at(0) // Output: 65 print result
Notes
- ASCII characters return the corresponding byte value; non-ASCII characters return Unicode code points.