python 字符串分割与拼接 2022-01-10 08:44:27 浏览数 (1) line = 'asdf fjdk; afed, fjek,asdf, foo' import re re.split(r'[;,s]s*', line) ['asdf', 'fjdk', 'afed', 'fjek', 'asdf', 'foo'] ''.join(v d for v,d in zip(values, delimiters)) 'asdf fjdk;afed,fjek,asdf,foo' import join line split zip 0 人点赞 上一篇:分享雷军22年前编写的代码