Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. var regex = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g
  2.  
  3. /**
  4. * Removes punctuation from a string.
  5. *
  6. * @param {string} string
  7. * @return {string}
  8. */
  9. function removePunctuation(string) {
  10. return string.replace(regex, '');
  11. }
  12.  
  13. module.exports = removePunctuation;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement