length
Returns number of characters. If the value provided is not a string, then it will be converted to a string first.
Attention: For numerals and dates with available string context, the string will be used.
A simpler approach is to use {} behind the set value, referred as length of sets.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1
No. | Type | Description |
---|---|---|
1 input |
set | input set Attention: If 1st parameter is not a set, please refer to length [string function] instead. |
Type | Description |
---|---|
numeral set |
Length Number of elements (nested elements are not counted) |
echo( length( {a,b,1} ) ); // 3 elements
echo( length( {a,{b,2,3}} ) ); // 2 elements (nested ones are not counted)
echo( length( {} ) ); // 0 elements (empty set)
echo( length( {{}} ) ); // 1 elements (contains 1 element which is a nested empty set)
3
2
0
1