diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-13 02:43:39 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-13 02:43:39 (GMT) |
commit | 8b1c47bb8bf061d1842075a9e6edcc2736b3b236 (patch) | |
tree | 86a88bc5f2a57618fa780e14a8778351c125f71e | |
parent | 49042041589dbebc1265bb878e6f00e5e1e9ef15 (diff) | |
download | cpython-8b1c47bb8bf061d1842075a9e6edcc2736b3b236.zip cpython-8b1c47bb8bf061d1842075a9e6edcc2736b3b236.tar.gz cpython-8b1c47bb8bf061d1842075a9e6edcc2736b3b236.tar.bz2 |
Document the optional argument to the .strip(), .rstrip(), .strip() string
methods.
Part of SF feature #444708.
-rw-r--r-- | Doc/lib/libstdtypes.tex | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index a619105..6f819e9 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -603,8 +603,12 @@ Padding is done using spaces. The original string is returned if Return a copy of the string converted to lowercase. \end{methoddesc} -\begin{methoddesc}[string]{lstrip}{} -Return a copy of the string with leading whitespace removed. +\begin{methoddesc}[string]{lstrip}{\optional{chars}} +Return a copy of the string with leading characters removed. If +\var{chars} is omitted or \code{None}, whitespace characters are +removed. If given and not \code{None}, \var{chars} must be a string; +the characters in the string will be stripped from the beginning of +the string this method is called on. \end{methoddesc} \begin{methoddesc}[string]{replace}{old, new\optional{, maxsplit}} @@ -632,8 +636,12 @@ Padding is done using spaces. The original string is returned if \var{width} is less than \code{len(\var{s})}. \end{methoddesc} -\begin{methoddesc}[string]{rstrip}{} -Return a copy of the string with trailing whitespace removed. +\begin{methoddesc}[string]{rstrip}{\optional{chars}} +Return a copy of the string with trailing characters removed. If +\var{chars} is omitted or \code{None}, whitespace characters are +removed. If given and not \code{None}, \var{chars} must be a string; +the characters in the string will be stripped from the end of the +string this method is called on. \end{methoddesc} \begin{methoddesc}[string]{split}{\optional{sep \optional{,maxsplit}}} @@ -649,16 +657,20 @@ boundaries. Line breaks are not included in the resulting list unless \var{keepends} is given and true. \end{methoddesc} -\begin{methoddesc}[string]{startswith}{prefix\optional{, start\optional{, end}}} +\begin{methoddesc}[string]{startswith}{prefix\optional{, + start\optional{, end}}} Return true if string starts with the \var{prefix}, otherwise return false. With optional \var{start}, test string beginning at that position. With optional \var{end}, stop comparing string at that position. \end{methoddesc} -\begin{methoddesc}[string]{strip}{} -Return a copy of the string with leading and trailing whitespace -removed. +\begin{methoddesc}[string]{strip}{\optional{chars}} +Return a copy of the string with leading and trailing characters +removed. If \var{chars} is omitted or \code{None}, whitespace +characters are removed. If given and not \code{None}, \var{chars} +must be a string; the characters in the string will be stripped from +the both ends of the string this method is called on. \end{methoddesc} \begin{methoddesc}[string]{swapcase}{} |