python 判断字符串是否为空

s=' '
if s.strip()=='':
    print 's is null'
或者
if not s.strip():
    print 's is null'

猜你喜欢

转载自blog.csdn.net/qq_31024823/article/details/87915813