0

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 Answer 1

3
import re

re.sub(r'(.\.)', '', a)

Where a is the string you want to replace in.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.