I have the following string
u'root\n |-- date: string (nullable = true)\n |-- zip: string (nullable = true)\n'
I would like to extract the column names. The column names have |--
before them and :
after them.
I could do this in two stages:
s = u'root\n |-- date: string (nullable = true)\n |-- zip: string (nullable = true)\n'
s = s.split('|-- ')
s = s.split(':')
However, I wanted to know if there is a way to split with two characters at once.