(TIL) Python: Check if string is null or empty
if mystring and mystring.strip():
print "not null and not empty string"
else:
print "null or empty string"
Via StackOverflow.
if mystring and mystring.strip():
print "not null and not empty string"
else:
print "null or empty string"
Via StackOverflow.
Comments