Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/join.n @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 1.2 KB
Line 
1'\"
2'\" Copyright (c) 1993 The Regents of the University of California.
3'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4'\"
5'\" See the file "license.terms" for information on usage and redistribution
6'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7'\"
8'\" RCS: @(#) $Id: join.n,v 1.9 2007/12/13 15:22:32 dgp Exp $
9'\"
10.so man.macros
11.TH join n "" Tcl "Tcl Built-In Commands"
12.BS
13'\" Note:  do not modify the .SH NAME line immediately below!
14.SH NAME
15join \- Create a string by joining together list elements
16.SH SYNOPSIS
17\fBjoin \fIlist \fR?\fIjoinString\fR?
18.BE
19
20.SH DESCRIPTION
21.PP
22The \fIlist\fR argument must be a valid Tcl list.
23This command returns the string
24formed by joining all of the elements of \fIlist\fR together with
25\fIjoinString\fR separating each adjacent pair of elements.
26The \fIjoinString\fR argument defaults to a space character.
27.SH EXAMPLES
28Making a comma-separated list:
29.CS
30set data {1 2 3 4 5}
31\fBjoin\fR $data ", "
32     \fB\(-> 1, 2, 3, 4, 5\fR
33.CE
34.PP
35Using \fBjoin\fR to flatten a list by a single level:
36.CS
37set data {1 {2 3} 4 {5 {6 7} 8}}
38\fBjoin\fR $data
39     \fB\(-> 1 2 3 4 5 {6 7} 8\fR
40.CE
41
42.SH "SEE ALSO"
43list(n), lappend(n), split(n)
44
45.SH KEYWORDS
46element, join, list, separator
Note: See TracBrowser for help on using the repository browser.