python中拆分字符串

python中拆分字符串

1、

>>> test1 = "abxcdxefxfh"
>>> test1
'abxcdxefxfh'
>>> test1.split(sep = "x")
['ab', 'cd', 'ef', 'fh']

 

posted @ 2021-05-01 21:51  小鲨鱼2018  阅读(381)  评论(0编辑  收藏  举报