Capy-Bearer Documentation

length

lib call

Capy

function length(value : string) s64
function length(value : any) s64
function length(value : [T]) s64

Description

length() counts bytes in strings. It counts entries in any maps and lists, and elements in arrays.

Parameters

value : text, an any map or list, or an array

Return Values

A byte count for text, or an entry count for maps, lists, and arrays.

Errors

length() traps when a scalar any reaches it.

Example

Capy

print(length("capy docs"), " / ", length(any(["a", "b"])), "\n")

Output

9 / 2