sajad torkamani

Suppose you want to remove any character that is not a letter or a space. Here’s one approach:

function removeChars(str) {
  return str.replace(/[^a-zA-Z\s]/g, '')
}
Tagged: Regex

Leave a comment

Your email address will not be published. Required fields are marked *