首页 > 编程语言 > 详细

Python3 istitle()方法

时间:2018-07-03 14:15:51      阅读:232      评论:0      收藏:0      [点我收藏+]

描述

istitle() 方法检测字符串中所有的单词拼写首字母是否为大写,且其他字母为小写。

语法

istitle()方法语法:

str.istitle()

参数

  • 无。

返回值

如果字符串中所有的单词拼写首字母是否为大写,且其他字母为小写则返回 True,否则返回 False.

实例

以下实例展示了istitle()方法的实例:

#!/usr/bin/python3


str = "This Is String Example...Wow!!!"
print (str.istitle())

str = "This is string example....wow!!!"
print (str.istitle())

以上实例输出结果如下:

True
False
  

Python3 istitle()方法

原文:https://www.cnblogs.com/dillon-china/p/9257786.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!