summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-03-25 16:41:31 (GMT)
committerGuido van Rossum <guido@python.org>1997-03-25 16:41:31 (GMT)
commitc8a80cdbad5d925400615e09c4bf720de5976181 (patch)
tree9950f6487fadd07c71475ff97b6602f837f988ed /Doc
parent4fc706705521cd8fed60a0403c903a377516ea95 (diff)
downloadcpython-c8a80cdbad5d925400615e09c4bf720de5976181.zip
cpython-c8a80cdbad5d925400615e09c4bf720de5976181.tar.gz
cpython-c8a80cdbad5d925400615e09c4bf720de5976181.tar.bz2
Added docs for replace() and replace1().
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libstring.tex13
-rw-r--r--Doc/libstring.tex13
2 files changed, 26 insertions, 0 deletions
diff --git a/Doc/lib/libstring.tex b/Doc/lib/libstring.tex
index 80222c1..284782a 100644
--- a/Doc/lib/libstring.tex
+++ b/Doc/lib/libstring.tex
@@ -227,6 +227,19 @@ Pad a numeric string on the left with zero digits until the given
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
diff --git a/Doc/libstring.tex b/Doc/libstring.tex
index 80222c1..284782a 100644
--- a/Doc/libstring.tex
+++ b/Doc/libstring.tex
@@ -227,6 +227,19 @@ Pad a numeric string on the left with zero digits until the given
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