python split

split()

>>> string = "www.abc.com.cn"
>>> print(string.split('.',1))
['www', 'abc.com.cn']
>>> print(string.split('.',2))
['www', 'abc', 'com.cn']

 

posted on 2018-05-09 17:33  yaoweilei  阅读(75)  评论(0编辑  收藏  举报

导航