I would like to split a string only where there are at least two or more whitespaces.
For example
str = '10DEUTSCH GGS Neue Heide 25-27 Wahn-Heide -1 -1'
print str.split()
Results:
['10DEUTSCH', 'GGS', 'Neue', 'Heide', '25-27', 'Wahn-Heide', '-1', '-1']
I would like it to look like this:
['10DEUTSCH', 'GGS Neue Heide 25-27', 'Wahn-Heide', '-1', '-1']
question from:https://stackoverflow.com/questions/12866631/python-split-a-string-with-at-least-2-whitespaces