#Python #Shorts
One thing I miss quite a bit from C# is the "IsNullOrWhiteSpace" extension method on the "string" type. I don't think you can create an extension method for built-in types in Python (please correct me if I am wrong) but the good news is that we can define a function that we can reuse and we can perform such check just in one line. The bad news is that it requires separate checks for when the string is None or empty, and when the string only contains whitespace.
-------------------------------------------------------------------------------------
Links:
Blog: https://evgenyurubkov.com
Twitter: / evgenyurubkov
Instagram: / evgenyurubkov
Youtube: / @codevev
Смотрите видео Python - Check If String is None, Empty or Whitespace in One Line!!! онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь codevev 18 Май 2021, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 607 раз и оно понравилось 17 людям.