【Python Trick】判断字符串是否为空 发表于 2017-11-16 | 分类于 Python str=''if str.strip()=='': print('str is null')if not str.strip(): print('str is null')str='hello'if str.strip(): print('str is not null')