440 B
440 B
title, type, tags, cover, dateModified
| title | type | tags | cover | dateModified | ||
|---|---|---|---|---|---|---|
| Remove non ASCII characters | snippet |
|
tram-car | 2020-10-22T20:24:30+03:00 |
Removes non-printable ASCII characters.
- Use
String.prototype.replace()with a regular expression to remove non-printable ASCII characters.
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'); // 'lorem-ipsum'