问题
python search character "x" next step delete this character "x" + character "x" -1 postion in string
Example x="1. 520 2. 529"
I am going to search in x
"." and delete "." and number before "." in end I want it look like x=" 520 529"
Before I created this topic I only find replace one character for one character
回答1:
import re
re.sub(r'(.\.)', '', a)
Where a
is the string you want to replace in.
来源:https://stackoverflow.com/questions/43957288/python-delete-2-character-in-string