summaryrefslogtreecommitdiffstats
path: root/doc/string.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-08-24 08:59:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-08-24 08:59:52 (GMT)
commita33eb678e592b4f802c15555558e1b609fc4a903 (patch)
treecfaba577a0028dc9efc966775bca7349f409f6c9 /doc/string.n
parent9d64c5eb03efc7877af95c76e10b926d3c0f4549 (diff)
downloadtcl-a33eb678e592b4f802c15555558e1b609fc4a903.zip
tcl-a33eb678e592b4f802c15555558e1b609fc4a903.tar.gz
tcl-a33eb678e592b4f802c15555558e1b609fc4a903.tar.bz2
Added clarifying note on [string map]'s behaviour.
Diffstat (limited to 'doc/string.n')
-rw-r--r--doc/string.n10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/string.n b/doc/string.n
index 26d1b10..ff331b4 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.20 2004/06/30 12:34:35 dkf Exp $
+'\" RCS: @(#) $Id: string.n,v 1.21 2004/08/24 08:59:54 dkf Exp $
'\"
.so man.macros
.TH string n 8.1 Tcl "Tcl Built-In Commands"
@@ -194,6 +194,14 @@ will have no affect for later key matches. For example,
\fBstring map {abc 1 ab 2 a 3 1 0} 1abcaababcabababc\fR
.CE
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,
+.CS
+\fBstring map {1 0 ab 2 a 3 abc 1} 1abcaababcabababc\fR
+.CE
+it will return the string \fB02c322c222c\fR.
.RE
.TP
\fBstring match\fR ?\fB\-nocase\fR? \fIpattern\fR \fIstring\fR