开发者

How do I convert this Python punctuation-stripping function to JavaScript?

Please can any开发者_StackOverflow中文版one translate this python code into 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, "");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜