小编Vic*_*Vic的帖子

如何使用text strip()函数?

我可以删除数字,但不能删除字母字符:

>>> text
'132abcd13232111'

>>> text.strip('123')
'abcd'
Run Code Online (Sandbox Code Playgroud)

为什么以下不起作用?

>>> text.strip('abcd')
'132abcd13232111'
Run Code Online (Sandbox Code Playgroud)

python string python-3.x

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1

python-3.x ×1

string ×1