zoukankan      html  css  js  c++  java
  • Python istitle() 方法

    描述

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

    语法

    istitle() 方法语法:

    S.istitle()

    参数

    • 无。

    返回值

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

    实例

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

    #!/usr/bin/python3
    
    
    S = "This Is String Example...Wow!!!"
    print (S.istitle())
    
    S = "This is string example....wow!!!"
    print (S.istitle())

    以上实例输出结果如下:

    True
    False
  • 相关阅读:
    JZ-C-36
    JZ-C-35
    JZ-C-34
    JZ-C-33
    JZ-C-32
    JZ-C-31
    JZ-C-30
    JZ-C-29
    JZ-C-28
    JZ-C-27
  • 原文地址:https://www.cnblogs.com/wushuaishuai/p/7686850.html
Copyright © 2011-2022 走看看