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
ae1b94b6
Commit
ae1b94b6
authored
Jun 01, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#14957: clarify splitlines docs.
Initial patch by Michael Driscoll, I added the example.
parent
3f7d1d33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Doc/library/stdtypes.rst
Doc/library/stdtypes.rst
+7
-1
No files found.
Doc/library/stdtypes.rst
View file @
ae1b94b6
...
...
@@ -1329,7 +1329,13 @@ functions based on regular expressions.
Return a list of the lines in the string, breaking at line boundaries. Line
breaks are not included in the resulting list unless *keepends* is given and
true.
true. This method uses the universal newlines approach to splitting lines.
Unlike :meth:`~str.split`, if the string ends with line boundary characters
the returned list does ``not`` have an empty last element.
For example, ``'ab c\n\nde fg\rkl\r\n'.splitlines()`` returns
``['ab c', '', 'de fg', 'kl']``, while the same call with ``splinelines(True)``
returns ``['ab c\n', '\n, 'de fg\r', 'kl\r\n']``.
.. method:: str.startswith(prefix[, start[, end]])
...
...
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