summaryrefslogtreecommitdiffstats
path: root/Doc/libstring.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-03-14 04:13:56 (GMT)
committerGuido van Rossum <guido@python.org>1997-03-14 04:13:56 (GMT)
commit7b7c5786161d9d443d13f56276620519587a2624 (patch)
treec5d097ab2a211732abf1d5821fe467b66e1580e9 /Doc/libstring.tex
parent612316f016d168e3991276b24a1319b0f7192b8b (diff)
downloadcpython-7b7c5786161d9d443d13f56276620519587a2624.zip
cpython-7b7c5786161d9d443d13f56276620519587a2624.tar.gz
cpython-7b7c5786161d9d443d13f56276620519587a2624.tar.bz2
Add optional 4th argument to [r]find and [r]index (end of slice).
Diffstat (limited to 'Doc/libstring.tex')
-rw-r--r--Doc/libstring.tex17
1 files changed, 10 insertions, 7 deletions
diff --git a/Doc/libstring.tex b/Doc/libstring.tex
index af3fd58..80222c1 100644
--- a/Doc/libstring.tex
+++ b/Doc/libstring.tex
@@ -103,24 +103,27 @@ This doesn't understand other non-printing characters or escape
sequences.
\end{funcdesc}
-\begin{funcdesc}{find}{s\, sub\optional{\, start}}
-Return the lowest index in \var{s} not smaller than \var{start} where the
-substring \var{sub} is found. Return \code{-1} when \var{sub}
-does not occur as a substring of \var{s} with index at least \var{start}.
+\begin{funcdesc}{find}{s\, sub\optional{\, start\optional{\,end}}}
+Return the lowest index in \var{s} not smaller than \var{start} and not
+greater than \var{end} where the substring \var{sub} is found. Return
+\code{-1} when \var{sub} does not occur as a substring of \var{s} with
+index at least \var{start} and less than \var{end}.
If \var{start} is omitted, it defaults to \code{0}. If \var{start} is
negative, \code{len(\var{s})} is added.
+If \var{end} is omitted, it defaults to \code{len(\var{s})}. If
+\var{end} is negative, \code{len(\var{s})} is added.
\end{funcdesc}
-\begin{funcdesc}{rfind}{s\, sub\optional{\, start}}
+\begin{funcdesc}{rfind}{s\, sub\optional{\, start\optional{\,end}}}
Like \code{find} but find the highest index.
\end{funcdesc}
-\begin{funcdesc}{index}{s\, sub\optional{\, start}}
+\begin{funcdesc}{index}{s\, sub\optional{\, start\optional{\,end}}}
Like \code{find} but raise \code{ValueError} when the substring is
not found.
\end{funcdesc}
-\begin{funcdesc}{rindex}{s\, sub\optional{\, start}}
+\begin{funcdesc}{rindex}{s\, sub\optional{\, start\optional{\,end}}}
Like \code{rfind} but raise \code{ValueError} when the substring is
not found.
\end{funcdesc}