Replacing a string by a slightly variation of itself

you can do in following way:

>>> a = "30.000"
>>> a.replace('.', '')
'30000'
>>> import re
>>> re.sub('\.', '', a)
'30000'

Leave a Comment