I have a concatenated string like this:
my_str = 'str1;str2;str3;'
and I would like to apply split
function to it and then convert the resulted list to a tuple, and get rid of any empty string resulted from the split
(notice the last ';' in the end)
So far, I am doing this:
tuple(filter(None, my_str.split(';')))
Is there any more efficient (in terms of speed and space) way to do it?