length, vlength
This function returns the number of characters in the string. New line symbols count as 1 character. 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.
Vectorization: The function names beginning with the prefix v support vectorization in the 1st function parameter.
Instead of providing a single value, you can provide a set or even a nested set which contain multiple values.
The function will then process every value and its return value contains a corresponding set containing all results.
Note:For these functions, you need add the prefix letter 'v' in front of the function name. Otherwise
the function recognizes a set and attempts to process sets and not strings.
See length [set function] for the corresponding set function.
A simpler approach is to use {} behind the string, referred as length of strings. This simplified appraoch runs faster, but assumes
a string value to be provided all times.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1
No. | Type | Description |
---|---|---|
1 input |
valid types | input string or value(s) Attention: Numerals and dates are converted to strings prior to processing. If 1st parameter is a set:
|
Type | Description |
---|---|
numeral set |
Length value(s) Number of characters. If vectorization has been applied, then the results are inside (nested) sets. |
echo( length( 007.0 ) ); // 5 characters (string context preserved)
echo( length( 007.0 + 0 ) ); // 1 character (7) after a calculation
echo( length( 1=1 ) ); // 4 characters (true)
echo( length( Hello ) ); // 5 chracters
echo( length( date(today)) ); // 10 characters: YYYY-MM-DD
5
1
4
5
10
length [set function]
width
length of strings