Python中同时用多个分隔符分割字符串的问题
使用正则表达式可以很好解决
import re
s = 'Hello!This?Is!What?I!Want'
ss = re.split('[!?]', s)
ss = ['Hello', 'This', 'Is', 'What', 'I', 'Want']
使用正则表达式可以很好解决
import re
s = 'Hello!This?Is!What?I!Want'
ss = re.split('[!?]', s)
ss = ['Hello', 'This', 'Is', 'What', 'I', 'Want']