@lang:str.at
Access one UTF-8 byte as a string; reject bytes belonging to multibyte characters.
On-chain (@lang:str.at!): Selects one UTF-8 byte; a byte belonging to a multibyte character is rejected.
Returns: string
Syntax
Section titled “Syntax”@lang:str.at(value index)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value | string | Source string |
index | number | Zero-based byte index (negative counts from the end) |
See Also
Section titled “See Also”- @str.slice — extract a substring
- @at — array element access
On-chain face (@str.at!)
Section titled “On-chain face (@str.at!)”Both modes select a single UTF-8 byte using a signed byte index. Negative indexes count from the end. Out-of-bounds indexes and bytes belonging to multibyte characters are rejected, since a partial character cannot form a valid string. Use @str.slice to select a complete multibyte character, or @bytes.at for raw bytes.