Skip to main content
 首页 » 编程设计

python之如何在python中删除字符串中任意位置的字母

2025年05月04日26itcoder

<分区>

比如我的String = 'xx22xx_1x_xxxx-xxxx',x可以是任意字母。 现在我想删除前两个位置的字母xx和第七个位置的1,以获得一个NewString = '22xx_x_xxxx-xxxx'。 有删除特定位置字母的功能吗?