任何人都可以将这段 python 代码翻译成 javascript。
#
def strip_punctuation(s):
#
for c in ',.":;!%$':
#
while s.find(c) is not -1:
#
s.replace(c, '')
最佳答案
function strip_punctuation(s) {
return s.replace(/[,.":;!%$]/g, "");
}
关于javascript - 如何将此 Python 标点符号去除功能转换为 JavaScript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2861528/