In Python I have a list of strings, some of which may be the empty string. What\'s the best way to get the first non-empty string?
To remove all empty strings,
[s for s in list_of_strings if s]
To get the first non-empty string, simply create this list and get the first element, or use the lazy method as suggested by wuub.