Reputation: 13
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
Upvotes: 0
Views: 111
Reputation: 2198
import re
re.sub(r'(.\.)', '', a)
Where a
is the string you want to replace in.
Upvotes: 3