Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

can you edit string.punctuation

>>> from string import punctuation
>>> from re import sub
>>> 
>>> string = "Fred-Daniels!"
>>> translator = str.maketrans('','', sub('-', '', punctuation))
>>> string
'Fred-Daniels!'
>>> string = string.translate(translator)
>>> string
'Fred-Daniels'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #edit
ADD COMMENT
Topic
Name
4+8 =