0
0

Python strに含む内容の判断

Posted at

s 为字符串

s.isalnum() 所有字符都是数字或者字母,为真返回 True,否则返回 False。

s.isalpha() 所有字符都是字母,为真返回 True,否则返回 False。

s.isdigit() 所有字符都是数字,为真返回 True,否则返回 False。

s.islower() 所有字符都是小写,为真返回 True,否则返回 False。

s.isupper() 所有字符都是大写,为真返回 True,否则返回 False。

s.istitle() 所有单词都是首字母大写,为真返回 True,否则返回 False。

s.isspace() 所有字符都是空白字符,为真返回 True,否则返回 False。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0