Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

remove punctuation from string python

#with re
import re
s = "string. With. Punctuation?"
s = re.sub(r'[^ws]','',s)
#without re
s = "string. With. Punctuation?"
s.translate(str.maketrans('', '', string.punctuation))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #punctuation #string #python
ADD COMMENT
Topic
Name
9+3 =