python的字符串内建函数9

 时间:2026-04-29 04:38:16

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
  • 热门搜索
    褐色怎么调 脸上长癣怎么办 可乐鸡翅怎么烧最好吃 棒球帽怎么洗 戟字怎么读 河蚌怎么做 秋季腹泻怎么治疗 浪琴表怎么样 cvt无级变速怎么开 水星路由器怎么设置