diff Doc/libstring.tex @ 5188:3ec3d8807f9e legacy-trunk

Add optional 4th argument to [r]find and [r]index (end of slice).
author Guido van Rossum <guido@python.org>
date Fri, 14 Mar 1997 04:13:56 +0000
parents 0ec2ce97b8e3
children 1f38d5fb3d23
line wrap: on
line diff
--- a/Doc/libstring.tex	Fri Mar 14 04:12:52 1997 +0000
+++ b/Doc/libstring.tex	Fri Mar 14 04:13:56 1997 +0000
@@ -103,24 +103,27 @@
 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}