Python 字符串方法
檢查文本中的所有字符是否都是空格:
txt = " " x = txt.isspace() print(x)
運行實例
如果字符串中的所有字符都是空格,則 isspace() 方法將返回 True,否則返回 False。
string.isspace()
無參數.
txt = " s " x = txt.isspace() print(x)