lst_to_str(L;D)
Returns a delimiter-separated string comprised of the elements in a list-value.
Syntax
lst_to_str(L;D)
Input
Argument | Type | Description |
---|---|---|
L |
list-value | The name of the list-value whose indexed values will be returned as a
delimiter-separated string A list-value |
D |
text | The character to be used as the delimiter in the string that is returned If
If A scalar value |
Return Value
Returns all the values of elements in list-value L
, as a string. The
original values are separated by the character provided to D
in the text
value that is returned.
If L
is omitted, the return value is an empty text value (e.g.,
''
).
If L
is N/A, the resultant value is the text value
'NA'
.
If D
is omitted, a comma (,
) is used as the default
delimiter.
If D
is N/A, then no delimiter is used and all values are returned as an
unbroken string.
Sample Usage
list="{lst(1 'a' 'A' 3.14159)}" element_string="lst_to_str(list;'|')"returns the values of the elements in
list
as a string
where the values are separated by a pipe character ( | ), as
follows:1|a|A|3.14159.
Example: Make a list-value a delimited string
Once a list-value is created, the values of its elements can be converted into a string
with the original values delimited by a character passed to D
.
<let list="{lst('hop' 'skip' 'jump')}" delim="-"> <willbe name="hopscotch" value="'{lst_to_str(@list;@delim)}'"/> </let>
The code above returns a single computed column that contains a dash-delimited string: hop-skip-jump.