Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8a80cd

Browse files
committed
Added docs for replace() and replace1().
1 parent 4fc7067 commit c8a80cd

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Doc/lib/libstring.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,19 @@ \section{Standard Module \sectcode{string}}
227227
width is reached. Strings starting with a sign are handled correctly.
228228
\end{funcdesc}
229229

230+
\begin{funcdesc}{replace}{old, new, str}
231+
Return a copy of string \var{str} with all occurrences of substring
232+
\var{old} replaced by \var{new}.
233+
\end{funcdesc}
234+
235+
\begin{funcdesc}{replace1}{old, new, str\optional{, start\optional{, end}}}
236+
Return a copy of string \var{str} with the first occurrence of
237+
substring \var{old} replaced by \var{new}. If no occurrence is found,
238+
\var{str} is returned unchanged. Optional arguments \var{start} and
239+
\var{end} limit the search for \var{old} like for \code{find} (they
240+
are not used to slice the result).
241+
\end{funcdesc}
242+
230243
This module is implemented in Python. Much of its functionality has
231244
been reimplemented in the built-in module \code{strop}. However, you
232245
should \emph{never} import the latter module directly. When

Doc/libstring.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,19 @@ \section{Standard Module \sectcode{string}}
227227
width is reached. Strings starting with a sign are handled correctly.
228228
\end{funcdesc}
229229

230+
\begin{funcdesc}{replace}{old, new, str}
231+
Return a copy of string \var{str} with all occurrences of substring
232+
\var{old} replaced by \var{new}.
233+
\end{funcdesc}
234+
235+
\begin{funcdesc}{replace1}{old, new, str\optional{, start\optional{, end}}}
236+
Return a copy of string \var{str} with the first occurrence of
237+
substring \var{old} replaced by \var{new}. If no occurrence is found,
238+
\var{str} is returned unchanged. Optional arguments \var{start} and
239+
\var{end} limit the search for \var{old} like for \code{find} (they
240+
are not used to slice the result).
241+
\end{funcdesc}
242+
230243
This module is implemented in Python. Much of its functionality has
231244
been reimplemented in the built-in module \code{strop}. However, you
232245
should \emph{never} import the latter module directly. When

0 commit comments

Comments
 (0)