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 @@ -2228,7 +2228,16 @@ expression support in the :mod:`re` module).
22282228 Return a string which is the concatenation of the strings in *iterable *.
22292229 A :exc: `TypeError ` will be raised if there are any non-string values in
22302230 *iterable *, including :class: `bytes ` objects. The separator between
2231- elements is the string providing this method.
2231+ elements is the string providing this method. For example:
2232+
2233+ .. doctest ::
2234+
2235+ >>> ' , ' .join([' spam' , ' spam' , ' spam' ])
2236+ 'spam, spam, spam'
2237+ >>> ' -' .join(' Python' )
2238+ 'P-y-t-h-o-n'
2239+
2240+ See also :meth: `split `.
22322241
22332242
22342243.. method :: str.ljust(width, fillchar=' ', /)
@@ -2442,6 +2451,8 @@ expression support in the :mod:`re` module).
24422451 >>> " foo ".split(maxsplit=0)
24432452 ['foo ']
24442453
2454+ See also :meth: `join `.
2455+
24452456
24462457.. index ::
24472458 single: universal newlines; str.splitlines method
You can’t perform that action at this time.
0 commit comments