Python字符串判断函数

c为字符串
1  c.isalnum() 所有字符都是数字或者字母
2  c.isalpha() 所有字符都是字母
3  c.isdigit() 所有字符都是数字
4  c.islower() 所有字符都是小写
5  c.isupper() 所有字符都是大写
6  c.istitle() 所有单词都是首字母大写,像标题
7  c.isspace() 所有字符都是空白字符、\t、\n、\r

猜你喜欢

转载自blog.csdn.net/qq_41996090/article/details/82118804