Skip to content

Instantly share code, notes, and snippets.

@remarkablemark
Last active September 29, 2019 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remarkablemark/6ef2779bee9d98bcfdc1fef2300f0476 to your computer and use it in GitHub Desktop.
Save remarkablemark/6ef2779bee9d98bcfdc1fef2300f0476 to your computer and use it in GitHub Desktop.
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