Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
95f42a86
Commit
95f42a86
authored
May 09, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#14763: fix documentation for string.split/rsplit.
parent
284fa08e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Doc/library/string.rst
Doc/library/string.rst
+8
-7
No files found.
Doc/library/string.rst
View file @
95f42a86
...
...
@@ -905,14 +905,15 @@ not be removed until Python 3. The functions defined in this module are:
Return a list of the words of the string *s*. If the optional second argument
*sep* is absent or ``None``, the words are separated by arbitrary strings of
whitespace characters (space, tab,
newline, return, formfeed). If the second
whitespace characters (space, tab, newline, return, formfeed). If the second
argument *sep* is present and not ``None``, it specifies a string to be used as
the word separator. The returned list will then have one more item than the
number of non-overlapping occurrences of the separator in the string. The
optional third argument *maxsplit* defaults to 0. If it is nonzero, at most
*maxsplit* number of splits occur, and the remainder of the string is returned
as the final element of the list (thus, the list will have at most
``maxsplit+1`` elements).
number of non-overlapping occurrences of the separator in the string.
If *maxsplit* is given, at most *maxsplit* number of splits occur, and the
remainder of the string is returned as the final element of the list (thus,
the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not
specified or ``-1``, then there is no limit on the number of splits (all
possible splits are made).
The behavior of split on an empty string depends on the value of *sep*. If *sep*
is not specified, or specified as ``None``, the result will be an empty list.
...
...
@@ -925,7 +926,7 @@ not be removed until Python 3. The functions defined in this module are:
Return a list of the words of the string *s*, scanning *s* from the end. To all
intents and purposes, the resulting list of words is the same as returned by
:func:`split`, except when the optional third argument *maxsplit* is explicitly
specified and nonzero.
When *maxsplit* is nonzero
, at most *maxsplit* number of
specified and nonzero.
If *maxsplit* is given
, at most *maxsplit* number of
splits -- the *rightmost* ones -- occur, and the remainder of the string is
returned as the first element of the list (thus, the list will have at most
``maxsplit+1`` elements).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment