Description:
Concatenate the distinct members in a sequence into a string, separated by a separator.
Syntax:
A.iconcat(d)
Note:
The function concatenates the distinct members of A into a string using separator d, processing any sub-sequences as well. If d is omitted, concatenate the members directly without a separator.
Option:
|
@q |
Wrap distinct values with quotation marks for concatenation. Do not handle them this way by default. |
|
@c |
Use comma as the separator. |
|
@i |
Wrap distinct values with single quotation marks for concatenation. |
|
@n |
When A is a sequence of sequences, concatenate the distinct members in A using separator d to form a string, then join the resulting strings with newline characters. This is equivalent to A.(~.iconcat(d)).iconcat("\n"). If other options are specified, apply them in the inner iconcat operation.
|
|
@0 |
Discard nulls and empty strings. |
Parameter:
|
A |
A sequence of strings. |
|
d |
The separator. |
Return value:
String
Example:
|
|
|
A |
|
|
1 |
|
=[1, ["a","b"],[2,"c"], ["a","b"]] |
|
|
2 |
|
=A1.iconcat() |
Concatenate distinct members in sequence A1, separated by the default separator, and return 1[ab][2c]. |
|
3 |
|
=A1.iconcat(":") |
Concatenate distinct members in sequence A1, separated by colon, and return 1:[a:b]:[2:c]. |
|
4 |
|
=A1.iconcat@q() |
With @q option, wrap distinct members with the quotation marks to concatenate them, and return 1["a""b"][2"c"]. |
|
5 |
|
=A1.iconcat@c() |
With @c option, use comma as the separator and return 1,[a,b],[2,c]. |
|
6 |
|
=A1.concat@i() |
With @i option, wrap distinct members with the single quotation marks to concatenate them, and return 1['a''b'][2'c']. |
|
7 |
|
=[[1,2,3], ["a","b","a"],[2,"c"],[1,2,3]] |
Return a sequence of sequences. |
|
8 |
|
=A7.concat@n("-") |
With @n option, concatenate members in the sequence of sequences using - as the separator, and separate the resulting strings with a single newline. The result is as follows:
|
|
9 |
|
=A7.concat@nc() |
With @nc options, return result as follows:
|
|
10 |
|
=[123,,456,null,789,456].iconcat(";") |
Return 123;;456;789. |
|
11 |
|
=[123,,456,null,789,456].iconcat@0(";") |
With @o option, discard nulls and empty strings, and return 123;456;789. |