summaryrefslogtreecommitdiffstats
path: root/doc/string.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-10-17 10:22:24 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-10-17 10:22:24 (GMT)
commit842e3ff91428c72a2ce0d4df4889778af82f4b12 (patch)
tree5a94240e321022019f593f6bd712833ab12138c6 /doc/string.n
parent8b464633a0f2df93912ad25af65a5724cd643da2 (diff)
downloadtcl-842e3ff91428c72a2ce0d4df4889778af82f4b12.zip
tcl-842e3ff91428c72a2ce0d4df4889778af82f4b12.tar.gz
tcl-842e3ff91428c72a2ce0d4df4889778af82f4b12.tar.bz2
Improve clarity of formatting.
Diffstat (limited to 'doc/string.n')
-rw-r--r--doc/string.n15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/string.n b/doc/string.n
index d0cb8d8..6e4a8a4 100644
--- a/doc/string.n
+++ b/doc/string.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: string.n,v 1.44 2008/06/29 22:28:24 dkf Exp $
+.\" RCS: @(#) $Id: string.n,v 1.45 2008/10/17 10:22:25 dkf Exp $
.\"
.so man.macros
.TH string n 8.1 Tcl "Tcl Built-In Commands"
@@ -61,13 +61,17 @@ forms accepted by the \fBindex\fR method), then the search is
constrained to start with the character in \fIhaystackString\fR specified by
the index. For example,
.RS
+.PP
.CS
\fBstring first a 0a23456789abcdef 5\fR
.CE
+.PP
will return \fB10\fR, but
+.PP
.CS
\fBstring first a 0123456789abcdef 11\fR
.CE
+.PP
will return \fB\-1\fR.
.RE
.TP
@@ -207,13 +211,17 @@ of the forms accepted by the \fBindex\fR method), then only the
characters in \fIhaystackString\fR at or before the specified \fIlastIndex\fR
will be considered by the search. For example,
.RS
+.PP
.CS
\fBstring last a 0a23456789abcdef 15\fR
.CE
+.PP
will return \fB10\fR, but
+.PP
.CS
\fBstring last a 0a23456789abcdef 9\fR
.CE
+.PP
will return \fB1\fR.
.RE
.TP
@@ -238,17 +246,21 @@ appearing first in the list will be checked first, and so on.
\fIstring\fR is only iterated over once, so earlier key replacements
will have no affect for later key matches. For example,
.RS
+.PP
.CS
\fBstring map {abc 1 ab 2 a 3 1 0} 1abcaababcabababc\fR
.CE
+.PP
will return the string \fB01321221\fR.
.PP
Note that if an earlier \fIkey\fR is a prefix of a later one, it will
completely mask the later one. So if the previous example is
reordered like this,
+.PP
.CS
\fBstring map {1 0 ab 2 a 3 abc 1} 1abcaababcabababc\fR
.CE
+.PP
it will return the string \fB02c322c222c\fR.
.RE
.TP
@@ -392,6 +404,7 @@ single character other than these.
.PP
Test if the string in the variable \fIstring\fR is a proper non-empty
prefix of the string \fBfoobar\fR.
+.PP
.CS
set length [\fBstring length\fR $string]
if {$length == 0} {