LENGTH …string-expr…
LENGTH …array…
STRING -> U32
t[] -> U32
Returns the number of bytes in a string.
For now, strings are just variable length sequences of bytes. However, the plan is to make them UTF8 though.
Can also return the length of an array.
expression | evaluates to |
---|---|
LENGTH "foo" | 3 |
LENGTH "" | 0 |
LENGTH CAST([42] AS U8[]) | 1 |