| 31 | split(str="", num=string.count(str)) 以 str 为分隔符截取字符串,如果 num 有指定值,则仅截取 num+1 个子字符串 |
| 32 | 按照行('\r', '\r\n', \n')分隔,返回一个包含各行作为元素的列表,如果参数 keepends 为 False,不包含换行符,如果为 True,则保留换行符。 |
| 33 | startswith(substr, beg=0,end=len(string)) 检查字符串是否是以指定子字符串 substr 开头,是则返回 True,否则返回 False。如果beg 和 end 指定值,则在指定范围内检查。 |
| 34 | 在字符串上执行 lstrip()和 rstrip() |
| 35 | 将字符串中大写转换为小写,小写转换为大写 |
| 36 | 返回"标题化"的字符串,就是说所有单词都是以大写开始,其余字母均为小写(见 istitle()) |
| 37 | translate(table, deletechars="") 根据 table 给出的表(包含 256 个字符)转换 string 的字符, 要过滤掉的字符放到 deletechars 参数中 |
| 38 | 转换字符串中的小写字母为大写 |
| 39 | 返回长度为 width 的字符串,原字符串右对齐,前面填充0 |
| 40 | 检查字符串是否只包含十进制字符,如果是返回 true,否则返回 false。 |