Python split and join

>>> s="I am fine"
>>> s
'I am fine'
>>> s.split(" ")
[
'I', 'am', 'fine']
>>> sList=s.split(" ")
>>> sList
[
'I', 'am', 'fine']
>>> "%".join(sList)
'I%am%fine'

Notes:

1)String is transfered to a List by split method

2)List can be joined a string by join method

Work for fun,Live for love!
原文地址:https://www.cnblogs.com/allenblogs/p/1804283.html