Returns the length of each element of a dynamic array.
The
LENS function returns the number of characters in each element of a dynamic array.
LENS counts characters, not bytes. Results are returned as a dynamic array of integers.
For numerics, prior to determining the length MVBasic performs all arithmetic operations and converts numbers to canonical form, with leading and trailing zeroes, a trailing decimal point, and all signs removed except a single minus sign. Note that
LENS does count the decimal point and the minus sign. Numeric strings are not converted to canonical form. An empty string ("") or a missing element returns a length of 0 for that element.
The following example uses the
LENS function to return the number of characters in each element of a dynamic array. Numbers are converted to canonical form: