So lets say I have a sentence read from a file:
hello what is your name
my name is david
I am trying to make a list of strings from this so it looks like:
['hello','what','is','your','name','my','name','is','david']
The main problem is when I use the split option, I can only specify one parameter to split the string by.
I end up with either
['hello what is your name','my name is david']
When splitting by '\n'
OR
['hello','what','is','your','name\n','my','name','is','david\n']
When splitting by 'spacebar'.
Is there a way I can combine both these parameters to produce the list of strings above these two?
Thanks.