目录
- isspace
- istitle
- isupper
- islower
- 未完待续的函数 join 与 split
isspace
- 功能:isspace判断字符串是否是个由空格组成的字符串
- 用法:
booltype = string.isspace ()
->无参数可传,返回一个布尔类型
In [31]: ' '.isspace()
0ut[31]: True
In [32]: 'hello insane'.isspace()
out [32]: False
- Ps:由空格组成的字符串,不是空字符串:
"!=,"
istitle
- 功能:istitle判断字符串是否是一个标题类型(所有单词全是首字母大写)
- 用法:
booltype = String.istitle()
-> 无参数可传,返回一个布尔类型
In [33]: 'Hello Insane'.istitle()
Out[33] : True
In [34]: 'hello insane'.istitle()
Out[34]: False
- Ps:该函数只能用于英文
isupper与islower
- 功能: