python的字符串内建函数12

 时间:2024-10-15 07:25:09

python中string模块有很多字符串的方法,下面简单列几个方法。

python的字符串内建函数12

工具/原料

python

电脑

字符串内建函数:

1、string.rstrip():删除字符串末尾的空格。

python的字符串内建函数12python的字符串内建函数12

2、string.split(str):以str为分隔符切片字符串。

python的字符串内建函数12python的字符串内建函数12

3、string.split(str, num):以str为分隔符切片字符串,如果num有值,则仅分隔num+1个子字符串。

python的字符串内建函数12python的字符串内建函数12

4、string.swapcase():翻转字符串中的大小写。

python的字符串内建函数12python的字符串内建函数12
  • python的字符串内建函数10
  • python的字符串内建函数7
  • python的字符串内建函数9
  • python的字符串内建函数13
  • python的字符串内建函数4
  • 热门搜索
    登鹳雀楼的意思 休闲西服配什么裤子 四字祝福语 什么护肤品适合20岁 阐述的意思 timer是什么意思 分期付款买车需要什么手续 一句简短的结婚祝福语 千山万壑的意思 hiphop是什么意思