主页
Python
Python 正则表达式
demo_regex_split
运行 ❯
×
更改方向
保存代码
更改主题
import re #Split the string at every white-space character: txt = "The rain in Spain" x = re.split("\s", txt) print(x)
['The', 'rain', 'in', 'Spain']