Answers for "python split string by tab"

2

python split string by tab

>>> import re
>>> strs = "foo\tbar\t\tspam"
>>> re.split(r'\t+', strs)
['foo', 'bar', 'spam']
Posted by: Guest on December-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language