File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments