Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split space or tab

>>> teststr = "a   v w   ef sdv   
   wef"
>>> print teststr
a   v w   ef sdv   
   wef
>>> teststr.split()
['a', 'v', 'w', 'ef', 'sdv', 'wef']
>>> teststr.split(" ")
['a', '', '', 'v', 'w', '', '', 'ef', 'sdv', '', '', '
', '', '', 'wef']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #split #space #tab
ADD COMMENT
Topic
Name
4+7 =