python split string by tab

105

python split string by tab -

>>> import re
>>> strs = "foo\tbar\t\tspam"
>>> re.split(r'\t+', strs)
['foo', 'bar', 'spam']

python split a string by tab -

split_string = a_string.split("\t")

Comments

Submit
0 Comments