python日积月累之isspace()

来源:互联网 发布:优衣库淘宝假货多吗 编辑:程序博客网 时间:2024/05/22 07:02

Python isspace() 方法检测字符串是否只由空格组成。

如果字符串中只包含空格,则返回 True,否则返回 False.

 

<span style="font-size:18px;">#coding:utf-8str1 = u"        "print str1.isspace()str2 = u"yuanyuan521521"print str2.isspace()</span>


 

0 0
原创粉丝点击