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 @@ -2086,7 +2086,16 @@ expression support in the :mod:`re` module).
20862086 Return a string which is the concatenation of the strings in *iterable *.
20872087 A :exc: `TypeError ` will be raised if there are any non-string values in
20882088 *iterable *, including :class: `bytes ` objects. The separator between
2089- elements is the string providing this method.
2089+ elements is the string providing this method. For example:
2090+
2091+ .. doctest ::
2092+
2093+ >>> ' , ' .join([' spam' , ' spam' , ' spam' ])
2094+ 'spam, spam, spam'
2095+ >>> ' -' .join(' Python' )
2096+ 'P-y-t-h-o-n'
2097+
2098+ See also :meth: `split `.
20902099
20912100
20922101.. method :: str.ljust(width, fillchar=' ', /)
@@ -2300,6 +2309,8 @@ expression support in the :mod:`re` module).
23002309 >>> " foo ".split(maxsplit=0)
23012310 ['foo ']
23022311
2312+ See also :meth: `join `.
2313+
23032314
23042315.. index ::
23052316 single: universal newlines; str.splitlines method
You can’t perform that action at this time.
0 commit comments