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
  • 热门搜索
    家长意见和建议怎么写 怎么做折线图 一个胸大一个胸小怎么办 阴阳眼怎么开 可可粉怎么吃 元宵怎么做 怎么折蝴蝶结 ps套索工具怎么用 怎么发红包 孕妇脚肿怎么办