From 0d8310f9be1577fb211b01fbbe020ea6621fc1e5 Mon Sep 17 00:00:00 2001 From: dkf Date: Tue, 11 May 2004 21:31:43 +0000 Subject: Added examples --- ChangeLog | 2 +- doc/join.n | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb26e72..ff9b232 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2004-05-11 Donal K. Fellows - * doc/split.n: Updated examples and added more. + * doc/split.n, doc/join.n: Updated examples and added more. 2004-05-11 Vince Darley diff --git a/doc/join.n b/doc/join.n index 45c6bda..d9fa0a1 100644 --- a/doc/join.n +++ b/doc/join.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: join.n,v 1.3 2000/09/07 14:27:48 poenitz Exp $ +'\" RCS: @(#) $Id: join.n,v 1.4 2004/05/11 21:31:43 dkf Exp $ '\" .so man.macros .TH join n "" Tcl "Tcl Built-In Commands" @@ -24,9 +24,23 @@ This command returns the string formed by joining all of the elements of \fIlist\fR together with \fIjoinString\fR separating each adjacent pair of elements. The \fIjoinString\fR argument defaults to a space character. +.SH EXAMPLES +Making a comma-separated list: +.CS +set data {1 2 3 4 5} +join $data ", " + \fB=> 1, 2, 3, 4, 5\fR +.CE + +Using \fBjoin\fR to flatten a list by a single level: +.CS +set data {1 {2 3} 4 {5 {6 7} 8}} +join $data + \fB=> 1 2 3 4 5 {6 7} 8\fR +.CE .SH "SEE ALSO" -list(n), lappend(n) +list(n), lappend(n), split(n) .SH KEYWORDS element, join, list, separator -- cgit v0.12