I have a string a='15/08/2017 TRANSFER OF LAND $610,000 CASH & MTGE'
. I need to extract 'TRANSFER OF LAND'
as one word(with spaces), '$610,000'
as other and 'CASH & MTGE'
(with spaces) as another word. How can I do this using python? I tried using split
function. But split
function doesn't include spaces.
b=a.split('15/08/2017',1)[1]
c=b.split()
I am getting ['TRANSFER', 'OF', 'LAND', '$610,000', 'CASH', '&', 'MTGE']
If I could also get number of whitespaces after split
, I could get the result with checking number of empty empty spaces after a string