Python中处理字符串之islower()方法的使用简介,pythonislower
Python中处理字符串之islower()方法的使用简介,pythonislower
islower()方法判断检查字符串的所有的字符(字母)是否为小写。
语法
以下是islower()方法的语法:
str.islower()
参数
- NA
返回值
如果字符串中的所有字符是小写且有至少有一个字符此方法返回true,否则返回false。
例子
下面的例子显示 islower()方法的使用。
#!/usr/bin/python str = "THIS is string example....wow!!!"; print str.islower(); str = "this is string example....wow!!!"; print str.islower();
当我们运行上面的程序,它会产生以下结果:
False True
相关内容
- python绘图方法实例入门,python绘图实例
- Python中isnumeric()方法的使用简介,pythonisnumeric
- python使用in操作符时元组和数组的区别分析,python操作
- Python处理字符串之isspace()方法的使用,pythonisspace
- Python中用于检查英文字母大写的isupper()方法,
- Python中处理字符串的相关的len()方法的使用简介,pyth
- 浅析Python中的join()方法的使用,pythonjoin
- 在Python中处理字符串之ljust()方法的使用简介,pythonlj
- Python中用于转换字母为小写的lower()方法使用简介,py
- Python中的lstrip()方法使用简介,pythonlstrip
评论关闭