主页
Python
Python String split() 方法
demo_ref_string_split2
运行 ❯
×
更改方向
保存代码
更改主题
txt = "hello, my name is Peter, I am 26 years old" x = txt.split(", ") print(x)
['hello', 'my name is Peter', 'I am 26 years old']