How to remove empty strings from a list of strings in Python?



You can use filter to filter out empty strings. The first argument of filter is lambda that will tell you if the string is empty. You can pass this lambda to be None, bool, len or a function that checks if the string is empty. Here are some of the ways in which you can check it:


Please click the below link to see the tutorial with easy examples
remove empty strings or null values from a list of strings in Python

raja
Published on 13-Dec-2017 18:47:18
Advertisements