I have the list of strings
list = ['1', '2', '3', '4', '', ' 5', ' ', ' 6', '', '']
and I want to get every item after a first empty string to get the below result
list = [' 5', ' ', ' 6', '', '']
note that I want to leave a empty strings that comes after
I wrote this function:
def get_message_text(list):
for i, item in enumerate(list):
del list[i]
if item == '':
break
return list
but I am getting the wrong results for no reason I know:
['2', '4', ' 5', ' ', ' 6', '', '']