Here’s how to use concat() function.
Description:
Concatenate parameters into a string.
Syntax:
concat(xi,…)
Note:
The function concatenates parameters xi,… into a string in which quotation marks will not be used
Parameter:
xi |
Any value that can be converted to a string; if it is a sequence, it will be broken up before concatenation. |
Return value:
A string
Example:
|
A |
|
1 |
=demo.query("select * from SCORES where SCORE>90") |
|
2 |
=A1.(SCORE) |
|
3 |
=A1.(SUBJECT) |
|
4 |
=concat(A2,A3) |
979691939797979691939797PEEnglishPEEnglishMathMathPEEnglishPEEnglishMathMath |
5 |
=concat(2,3,"a") |
23a |
Related functions:
Description:
Concatenate members of a sequence with the delimiter and return result as a string.
Syntax:
A.concat(d)
Note:
The function concatenates members of A delimited by d and returns result as into a string; the sub-sequences of the string will be handled in a same way. Concatenate the members without a delimiter when parameter d is omitted.
Option:
@q |
Add quotation marks to string members when concatenating them into a string. If this option is omitted, do not use the quotation marks. |
@c |
Concatenate with the comma |
@i |
Enclose string members to be concatenated with single quotes |
@n |
If members of the sequence are also sequences, create a newl line after concatenate members of each sequence members with the delimiter. The operations are equivalent to A.(~.concat(d)).concat("\n"). If there are other options, perform the concatenation in the inner layer of the function. |
Parameter:
A |
A sequence of strings |
d |
Delimiter |
Return value:
A string after concatenation
Example:
|
A |
|
1 |
=[1, ["a","b"],[2,"c"]] |
|
2 |
=A1.concat() |
Concatenate members of sequence A1 without using the separator; the result is 1[ab][2c] |
3 |
=A1.concat(":") |
Concatenate members of sequence A1 using colon as the separator; the result is 1:[a:b]:[2:c] |
4 |
=A1.concat@q() |
Use @q option to do the concatenation with the quotation marks retained; the result is 1["a""b"][2"c"] |
5 |
=A1.concat@c() |
Use @c option to do the concatenation with comma being the separator; the result is 1,[a,b],[2,c] |
6 |
=A1.concat@i() |
Use @i option to do the concatenation with members bing enclosed by single quotation marks; the result is 1['a''b'][2'c'] |
7 |
=[[1,2,3], ["a","b"],[2,"c"]] |
Return a sequence of sequences |
8 |
=A7.concat@n("-") |
Use @n option to join members of each sub-sequence in sequence A7 with the separator “-” and use the line break for a new sub-sequence; the result is as follows:
|
9 |
=A7.concat@nc() |
Use @nc options to do the concatenation; below is the result:
|