helldrg Asked:2022-04-16 21:54:48 +0800 CST2022-04-16 21:54:48 +0800 CST 2022-04-16 21:54:48 +0800 CST 遇到给定字符之一时如何拆分字符串? 772 如何在第一次遇到这些字符时拆分字符串: ' ', ')', 'a', '3' 除了拼写这个句子,我想不出别的了。 python 1 个回答 Voted Best Answer MaxU - stop genocide of UA 2022-04-16T21:58:11+08:002022-04-16T21:58:11+08:00 使用re.split(): import re strings = re.split(r"[ \)a3]", input_str)
使用re.split():