@lang:bytes.len
Byte length of a bytes value (a UTF-8 character may span several bytes).
Returns: number
Syntax
Section titled “Syntax”@lang:bytes.len(value)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
value | bytes | Source bytes or string value |
See Also
Section titled “See Also”On-chain face (@bytes.len!)
Section titled “On-chain face (@bytes.len!)”The decoded byte length of the string/bytes return of a call, on-chain — UTF-8 characters may span multiple bytes.
Examples
Section titled “Examples”load lang
set $gov 0xc0dbDcA66a0636236fAbe1B3C16B1bD4C84bB1E1
# A uint256[] with 2 items is 64 + 2*32 = 128 bytesassert @bytes.len!($gov::{tallies()(uint256[])}) == 128See Also
Section titled “See Also”@len!