📜  python 拆分空格或制表符 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:35.448000             🧑  作者: Mango

代码示例1
>>> teststr = "a   v w   ef sdv   \n   wef"
>>> print teststr
a   v w   ef sdv   
   wef
>>> teststr.split()
['a', 'v', 'w', 'ef', 'sdv', 'wef']
>>> teststr.split(" ")
['a', '', '', 'v', 'w', '', '', 'ef', 'sdv', '', '', '\n', '', '', 'wef']