机器人
AI 摘要
切换
CatGPT - TianliGPT(1)
字符串中返回 bool 类型的函数集合 isspace 功能:判断字符串是否是由一个空格组成的字符串 用法: booltype = string.isspace () -> 无参数可传,返回一个布尔类型 注意:由空格组成的字符串,不是空字符串 : “’!=‘’’ istitile 功能:判断字符串是否是一个标题类型 用法 booltype = String.istitle (

字符串中返回 bool 类型的函数集合

isspace

功能:
  • 判断字符串是否是由一个空格组成的字符串
用法:
  • booltype = string.isspace() -> 无参数可传,返回一个布尔类型
注意:
  • 由空格组成的字符串,不是空字符串 : “’!=‘’’

istitile

功能:
  • 判断字符串是否是一个标题类型
用法
  • booltype = String.istitle() -> 无参数可传,返回一个布尔类型
注意:
  • 该函数只能用于英文

isupper 与 islower

功能:
  • isupper 判断字符串中的字母是否都是大写
  • islower 判断字符串中的字母是否都是小写
用法:
  • booltype = string.isupper() -> 无参数可传,返回一个布尔类型
  • booltype = string,islower() -> 无参数可传,返回一个布尔类型
注意:
  • 只检测字符串里的字母,对其他字符不做判断

join 与 split 稍后见

  • 我们数据类型转换的时候见

代码