summaryrefslogtreecommitdiffstats
path: root/doc/split.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-10-25 09:25:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-10-25 09:25:27 (GMT)
commit859f56b5099b2bfd3ad42becd2aaddca16196ce2 (patch)
treea55358a428b5851b24d6a6406ae63dc80f3b016d /doc/split.n
parent79cc10a2e22854d53a72f18f95e87a867df9925a (diff)
downloadtcl-859f56b5099b2bfd3ad42becd2aaddca16196ce2.zip
tcl-859f56b5099b2bfd3ad42becd2aaddca16196ce2.tar.gz
tcl-859f56b5099b2bfd3ad42becd2aaddca16196ce2.tar.bz2
GOOBE for command results in examples
Diffstat (limited to 'doc/split.n')
-rw-r--r--doc/split.n17
1 files changed, 9 insertions, 8 deletions
diff --git a/doc/split.n b/doc/split.n
index 1333716..c41aada 100644
--- a/doc/split.n
+++ b/doc/split.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: split.n,v 1.5 2004/10/27 14:24:37 dkf Exp $
+'\" RCS: @(#) $Id: split.n,v 1.6 2007/10/25 09:25:27 dkf Exp $
'\"
.so man.macros
.TH split n "" Tcl "Tcl Built-In Commands"
@@ -16,7 +16,6 @@ split \- Split a string into a proper Tcl list
.SH SYNOPSIS
\fBsplit \fIstring \fR?\fIsplitChars\fR?
.BE
-
.SH DESCRIPTION
.PP
Returns a list created by splitting \fIstring\fR at each character
@@ -33,28 +32,32 @@ If \fIsplitChars\fR is an empty string then each character of
.SH EXAMPLES
Divide up a USENET group name into its hierarchical components:
.CS
+.ta 2i
\fBsplit\fR "comp.lang.tcl.announce" .
- \fI=> comp lang tcl announce\fR
+ \fB\(->\fI comp lang tcl announce\fR
.CE
.PP
See how the \fBsplit\fR command splits on \fIevery\fR character in
\fIsplitChars\fR, which can result in information loss if you are not
careful:
.CS
+.ta 2i
\fBsplit\fR "alpha beta gamma" "temp"
- \fI=> al {ha b} {} {a ga} {} a\fR
+ \fB\(->\fI al {ha b} {} {a ga} {} a\fR
.CE
.PP
Extract the list words from a string that is not a well-formed list:
.CS
+.ta 2i
\fBsplit\fR "Example with {unbalanced brace character"
- \fI=> Example with \\{unbalanced brace character\fR
+ \fB\(->\fI Example with \\{unbalanced brace character\fR
.CE
.PP
Split a string into its constituent characters
.CS
+.ta 2i
\fBsplit\fR "Hello world" {}
- \fI=> H e l l o { } w o r l d\fR
+ \fB\(->\fI H e l l o { } w o r l d\fR
.CE
.SS "PARSING RECORD-ORIENTED FILES"
Parse a Unix /etc/passwd file, which consists of one entry per line,
@@ -80,9 +83,7 @@ foreach rec $records {
puts "$longName uses [file tail $shell] for a login shell"
}
.CE
-
.SH "SEE ALSO"
join(n), list(n), string(n)
-
.SH KEYWORDS
list, split, string