python delete 2 character in string

后端 未结 1 1851
终归单人心
终归单人心 2021-01-28 03:56

python search character \"x\" next step delete this character \"x\" + character \"x\" -1 postion in string

Example x=\"1. 520 2. 529\"

I am g

相关标签:
1条回答
  • 2021-01-28 04:19
    import re
    
    re.sub(r'(.\.)', '', a)
    

    Where a is the string you want to replace in.

    0 讨论(0)
提交回复
热议问题