python str.title( )和str.istitle( )
来源:互联网 发布:淘宝9月份活动 编辑:程序博客网 时间:2024/06/10 05:57
本文介绍python中字符串的两个内建函数,str.title( )和str.istitle( )
>>> help(str.title)
Help on method_descriptor:title(...)
S.title() -> string
Return a titlecased version of S, i.e. words start with uppercase
characters, all remaining cased characters have lowercase.
>>> 'love python!'.title()
'Love Python!'
>>> 'a strange dog'.title()
'A Strange Dog'
>>> help(str.istitle)
Help on method_descriptor:
istitle(...)
S.istitle() -> bool
Return True if S is a titlecased string and there is at least one
character in S, i.e. uppercase characters may only follow uncased
characters and lowercase characters only cased ones. Return False
otherwise.
>>> ''.istitle()
False
>>> 'Love python!'.istitle()
False
>>> 'Love Python!'.istitle()
True
(完)
1 0
- python str.title( )和str.istitle( )
- python-str()和 repr()
- Python str
- python-str()
- Python的str()和repr()
- python中的repr和str
- python 编码unicode 和 str
- python中str和basestring
- python中的str()和repr()
- python字符串内建函数str.index()和str.rindex()
- str
- str()
- str
- str
- str
- strlen(str)和sizeof(str)
- char *str 和 char str[]
- 区别python 的str和repr
- 多重部分和问题
- instanceof运算符
- 虚拟化学习笔记1-概述
- BZOJ 2330 [SCOI 2011] 糖果 差分约束
- Java不同类型密钥库之PKCS12和JCEKS
- python str.title( )和str.istitle( )
- 输出双螺旋矩阵
- 高效计算余数
- android resources类型
- 2016"百度之星" - 初赛(Astar Round2A)题解
- 实习入职第三天:真机调试,用eclipse单步跟踪查看代码---代码超大的情况
- ARM Linux S3C2440之ADC驱动实现
- 配置Nginx expires缓存实现性能优化
- Bestcoder 大数求余