python remove all letter from string code example
Example 1: python remove all except numbers
>>> import re
>>> re.sub('\D', '', 'aas30dsa20')
'3020'
Example 2: delete certain characters from a string python
for char in line:
if char in " ?.!/;:":
line.replace(char,'')