问题:
It seems like there should be a simpler way than: 似乎应该有一个比以下方法更简单的方法:
import string
s = "string. With. Punctuation?" # Sample string
out = s.translate(string.maketrans("",""), string.punctuation)
Is there? 在那儿?
解决方案:
参考一: https://stackoom.com/question/17Bg/从字符串中删除标点符号的最佳方法参考二: https://oldbug.net/q/17Bg/Best-way-to-strip-punctuation-from-a-string
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4411042