Python 字符串Python isspace()方法本页总览Python isspace()方法描述Python isspace() 方法检测字符串是否只由空格组成。语法isspace()方法语法:str.isspace()参数无。返回值如果字符串中只包含空格,则返回 True,否则返回 False.示例以下实例展示了 isspace()方法的实例:示例(Python 2.0+)#!/usr/bin/pythonstr = " "print str.isspace()str = "This is string example....wow!!!"print str.isspace()以上实例输出结果如下:TrueFalse