I would like to replace (and not remove) all punctuation characters by \" \" in a string in Python.
Is there something efficient of the following flavo
Replace by ''?.
''?
What's the difference between translating all ; into '' and remove all ;?
;
Here is to remove all ;:
s = 'dsda;;dsd;sad' table = string.maketrans('','') string.translate(s, table, ';')
And you can do your replacement with translate.