30 seconds of code

  Back to Home

removeNonASCII

stringregexpintermediate

Removes non-printable ASCII characters.

Use a regular expression to remove non-printable ASCII characters.

const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');