I have a big string where there are multiple lines. For example,
abc def
ghi hij
When I do .split() with the above string, I get as follows:
['abc', 'def\n', 'ghi', 'hih']
The output I want is,
['abc', 'def', '\n', 'ghi', 'hih']
There can be cases where .split() leads to:-
['abc', '\n', 'dsa\n\n\nkij', 'poi']
I want this actually as follow:
['abc', '\n', 'dsa', '\n', '\n', '\n', 'kij', 'poi']
I would like to have a simple python code.