python的字符串内建函数9

 时间:2026-02-16 01:01:07

1、string.maketrans(a, b):用于字符映射的转换,第一个参数表示需要转换的字符,第二个参数表示转换的目标。

python的字符串内建函数9

python的字符串内建函数9

2、string.partition(str):从str出现的第一个位置起,把字符串分成一个3元素的元组(a,str,b)。

python的字符串内建函数9

python的字符串内建函数9

3、string.partition(str):如果字符串中不包含str,则元组后2个元素为空。

python的字符串内建函数9

python的字符串内建函数9

4、string.rjust(长度):返回一个原字符串右对齐,并使用空格填充至指定长度的新字符串。

python的字符串内建函数9

python的字符串内建函数9

  • python的字符串内建函数8
  • python的字符串format函数
  • python的字符串内建函数1
  • python的字符串内建函数4
  • python的字符串内建函数3
  • 热门搜索
    甘蓝怎么吃 白板笔怎么擦掉 汤面怎么做好吃 瘪怎么读 花呗怎么提额度 降落伞怎么做 怎么清理注册表 黑眼圈是怎么回事 孕妇贫血怎么补 手发麻是怎么回事