@str.at
Access a character by index in a string.
Returns: string
Syntax
Section titled “Syntax”@str.at(value index)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value |
string |
Input value |
index |
number |
Zero-based character index |
Examples
Section titled “Examples”# Get the first characterset $s "hello"set $c @str.at($s 0)
# Get the last character (negative index)set $s "hello"set $l @str.at($s -1)See Also
Section titled “See Also”- @str.slice — extract a substring
- @at — array element access