您的位置:首页 > 编程语言 > Python开发

【Python】如何判断一个字符串为空

2014-03-13 21:18 706 查看
#方法一
if oneString:
print "not empty"
else:
print "empty"

#方法二
if oneString == "":
print "empty"
else:
print "not empty"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息