diff Doc/lib/libstring.tex @ 3858:8b71ea5dacc8 legacy-trunk

Added maketrans() and optional 3rd arg to translate() (chars to delete).
author Guido van Rossum <guido@python.org>
date Tue, 30 Jul 1996 18:23:05 +0000
parents 046888da1f44
children 0ec2ce97b8e3
line wrap: on
line diff
--- a/Doc/lib/libstring.tex	Tue Jul 30 18:22:31 1996 +0000
+++ b/Doc/lib/libstring.tex	Tue Jul 30 18:23:05 1996 +0000
@@ -123,6 +123,13 @@
 Convert letters to lower case.
 \end{funcdesc}
 
+\begin{funcdesc}{maketrans}{from, to}
+Return a translation table suitable for passing to \code{string.translate}
+or \code{regex.compile}, that will map each character in \var{from} 
+into the character at the same position in \var{to}; \var{from} and
+\var{to} must have the same length. 
+\end{funcdesc}
+
 \begin{funcdesc}{split}{s}
 Return a list of the whitespace-delimited words of the string
 \var{s}.
@@ -159,10 +166,11 @@
 Convert lower case letters to upper case and vice versa.
 \end{funcdesc}
 
-\begin{funcdesc}{translate}{s, table}
-Translate the characters from \var{s} using \var{table}, which must be
+\begin{funcdesc}{translate}{s, table\optional{, deletechars}}
+Delete all characters from \var{s} that are in \var{deletechars} (if present), and 
+then translate the characters using \var{table}, which must be
 a 256-character string giving the translation for each character
-value, indexed by its ordinal.
+value, indexed by its ordinal.  
 \end{funcdesc}
 
 \begin{funcdesc}{upper}{s}