demo_regex_split2.py:
import re #Split the string at the first white-space character: txt = "The rain in Spain" x = re.split("\s", txt, 1) print(x)
C:\Users\My Name>python demo_regex_split2.py
['The', 'rain in Spain']