zoukankan      html  css  js  c++  java
  • python判断字符串是字母 数字 大小写

    python判断字符串是字母 数字 大小写

    学习了:https://blog.csdn.net/liulirong1995/article/details/78349288?locationNum=8&fps=1

    字符串.isalnum()  所有字符都是数字或者字母,为真返回 Ture,否则返回 False。
    
    字符串.isalpha()   所有字符都是字母,为真返回 Ture,否则返回 False。
    
    字符串.isdigit()     所有字符都是数字,为真返回 Ture,否则返回 False。
    
    字符串.islower()    所有字符都是小写,为真返回 Ture,否则返回 False。
    
    字符串.isupper()   所有字符都是大写,为真返回 Ture,否则返回 False。
    
    字符串.istitle()      所有单词都是首字母大写,为真返回 Ture,否则返回 False。
    
    字符串.isspace()   所有字符都是空白字符,为真返回 Ture,否则返回 False。

    s.capitalize( ) ; s是列表。这个方法可以把列表的字符串首字母都大写,非首字母小写
  • 相关阅读:
    OpenCV && C++ 01
    图像矩的理解
    Halcon Example
    LabVIEW
    Working Experience
    Working Experience
    Working Experience
    C++
    Trigger,Cursor
    Paging
  • 原文地址:https://www.cnblogs.com/stono/p/9102043.html
Copyright © 2011-2022 走看看