I have a list of strings and need to remove the sequences of empty strings only at the beginning and end of the list. I need to keep any empty strings that are between non-empty strings.
For example,
my_list = ['', '', 'Sam sits', '', 'Thinking of you.', '', 'All ideas bad.', '', '', '']
The output should be;
['Sam sits', '', 'Thinking of you.', '', 'All ideas bad.']
Most methods i have tried to use get rid of the blank lines in the middle too. Any advice would be greatly appreciated.