width
This function returns the number of characters in the longest row in the string. If the value provided is not a string, then it will be converted to a string first.
If the string contains no new line symbol, then the total number of characters is returned, like in function length [string function].
Attention: For numerals and dates with available string context, the string will be used.
Vectorization: This function supports 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.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1
No. | Type | Description |
---|---|---|
1 input |
string | input string or value Values not of string type will be converted to strings first. sets will be rejected. |
Type | Description |
---|---|
numeral set |
Width(s) Number of characters of longest row. In case of vectorization, the numbers for all strings are provided in a set. |
text[] = compose( Hello, new line, Everyone, new line, "!!!" );
echo(text[], new line );
echo( "Width = ", width(text[]), new line, "Length = ", length(text[]) );
Hello
Everyone
!!!
Width = 8
Length = 18