1join(n) Tcl Built-In Commands join(n)
2
3
4
5______________________________________________________________________________
6
8 join - Create a string by joining together list elements
9
11 join list ?joinString?
12______________________________________________________________________________
13
15 The list argument must be a valid Tcl list. This command returns the
16 string formed by joining all of the elements of list together with
17 joinString separating each adjacent pair of elements. The joinString
18 argument defaults to a space character.
19
21 Making a comma-separated list:
22
23 set data {1 2 3 4 5}
24 join $data ", "
25 → 1, 2, 3, 4, 5
26
27 Using join to flatten a list by a single level:
28
29 set data {1 {2 3} 4 {5 {6 7} 8}}
30 join $data
31 → 1 2 3 4 5 {6 7} 8
32
34 list(n), lappend(n), split(n)
35
37 element, join, list, separator
38
39
40
41Tcl join(n)