如何将字符串拆分为两个相反的值?例如(
and )
是“分隔符”,我有以下字符串:
Wouldn't it be (most) beneficial to have (at least) some idea?
我需要以下输出(作为数组)
["Wouldn't it be ", "most", " beneficial to have ", "at least", " some idea?"]
re.split http://docs.python.org/library/re.html()
s = "Wouldn't it be (most) beneficial to have (at least) some idea?"
l = re.split('[()]', s);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)