jeudi 18 avril 2019

Removing specific pattern from string in Python?

I have a string such as

' This is a nice string with some size in inches at the end 25.6" '

Number before the double quotes might be float or integer of any length. I want to remove everything between a space and double quote sign. Right now I am trying to do something with .find() functions to get the index of double quote sign and the last space and then to remove each symbol between those indexes. Is there any smarter way to do so?

Aucun commentaire:

Enregistrer un commentaire