diff Doc/lib/libstring.tex @ 5212:1f38d5fb3d23 legacy-trunk

Added docs for replace() and replace1().
author Guido van Rossum <guido@python.org>
date Tue, 25 Mar 1997 16:41:31 +0000
parents 3ec3d8807f9e
children c5fd327057c6
line wrap: on
line diff
--- a/Doc/lib/libstring.tex	Tue Mar 25 16:06:03 1997 +0000
+++ b/Doc/lib/libstring.tex	Tue Mar 25 16:41:31 1997 +0000
@@ -227,6 +227,19 @@
 width is reached.  Strings starting with a sign are handled correctly.
 \end{funcdesc}
 
+\begin{funcdesc}{replace}{old, new, str}
+Return a copy of string \var{str} with all occurrences of substring
+\var{old} replaced by \var{new}.
+\end{funcdesc}
+
+\begin{funcdesc}{replace1}{old, new, str\optional{, start\optional{, end}}}
+Return a copy of string \var{str} with the first occurrence of
+substring \var{old} replaced by \var{new}.  If no occurrence is found,
+\var{str} is returned unchanged.  Optional arguments \var{start} and
+\var{end} limit the search for \var{old} like for \code{find} (they
+are not used to slice the result).
+\end{funcdesc}
+
 This module is implemented in Python.  Much of its functionality has
 been reimplemented in the built-in module \code{strop}.  However, you
 should \emph{never} import the latter module directly.  When