Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var regex = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g
/**
* Removes punctuation from a string.
*
* @param {string} string
* @return {string}
*/
function removePunctuation(string) {
return string.replace(regex, '');
}
module.exports = removePunctuation;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment