GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-106318: Add examples for str.join() (GH-140315) · miss-islington/cpython@4c1c99e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Doc/library
    • stdtypes.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Doc/library/stdtypes.rst‎

Copy file name to clipboardExpand all lines: Doc/library/stdtypes.rst
+12-1Lines changed: 12 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,16 @@ expression support in the :mod:`re` module).
22222222
Return a string which is the concatenation of the strings in *iterable*.
22232223
A :exc:`TypeError` will be raised if there are any non-string values in
22242224
*iterable*, including :class:`bytes` objects. The separator between
2225-
elements is the string providing this method.
2225+
elements is the string providing this method. For example:
2226+
2227+
.. doctest::
2228+
2229+
>>> ', '.join(['spam', 'spam', 'spam'])
2230+
'spam, spam, spam'
2231+
>>> '-'.join('Python')
2232+
'P-y-t-h-o-n'
2233+
2234+
See also :meth:`split`.
22262235

22272236

22282237
.. method:: str.ljust(width, fillchar=' ', /)
@@ -2436,6 +2445,8 @@ expression support in the :mod:`re` module).
24362445
>>> " foo ".split(maxsplit=0)
24372446
['foo ']
24382447

2448+
See also :meth:`join`.
2449+
24392450

24402451
.. index::
24412452
single: universal newlines; str.splitlines method

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.