length()

Synopsis

If argument is a List, returns the length of list. Nested lists, if any, count as a single item. If argument is a String, returns length of a string, in characters. Any other type of argument results in error.

Syntax

length ( item As Any ) As Integer
Argument Type Description
item Any List or String only; all other types result in an error.

Example 1

List length
Intent >length({ :a, :b, :c, :d, :e})
--> 5 

Example 2

List length with a nested list
Intent >length({ :a, {:b, :c}, :d, :e})
--> 4 

Example 3

String length
Intent >length("abcdefghijklmnopqrstuvwxyz") 
--> 26