2 '\" Copyright (c) 1993 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 .TH concat n 8.3 Tcl "Tcl Built-In Commands"
11 '\" Note: do not modify the .SH NAME line immediately below!
13 concat \- Join lists together
15 \fBconcat\fI \fR?\fIarg arg ...\fR?
19 This command joins each of its arguments together with spaces after
20 trimming leading and trailing white-space from each of them. If all of the
21 arguments are lists, this has the same effect as concatenating them
23 Arguments that are empty (after trimming) are ignored entirely.
24 It permits any number of arguments;
25 if no \fIarg\fRs are supplied, the result is an empty string.
27 Although \fBconcat\fR will concatenate lists, flattening them in the process
28 (so giving the following interactive session):
31 \fI%\fR \fBconcat\fR a b {c d e} {f {g h}}
32 \fIa b c d e f {g h}\fR
35 it will also concatenate things that are not lists, as can be seen from this
39 \fI%\fR \fBconcat\fR " a b {c " d " e} f"
43 Note also that the concatenation does not remove spaces from the middle of
44 values, as can be seen here:
47 \fI%\fR \fBconcat\fR "a b c" { d e f }
51 (i.e., there are three spaces between each of the \fBa\fR, the \fBb\fR and the
54 append(n), eval(n), join(n)
56 concatenate, join, list