Add removeNonASCII
This commit is contained in:
13
snippets/removeNonASCII.md
Normal file
13
snippets/removeNonASCII.md
Normal file
@ -0,0 +1,13 @@
|
||||
### removeNonASCII
|
||||
|
||||
Removes non-printable ASCII characters.
|
||||
|
||||
Use a regular expression to remove non-printable ASCII characters.
|
||||
|
||||
```js
|
||||
const removeNonASCII = str => str.replace(/[^\x20-\x7E]/g, '');
|
||||
```
|
||||
|
||||
```js
|
||||
removeNonASCII('äÄçÇéÉêlorem-ipsumöÖÐþúÚ'); // 'lorem-ipsum'
|
||||
```
|
||||
@ -188,6 +188,7 @@ reducedFilter:array
|
||||
reduceSuccessive:array,function
|
||||
reduceWhich:array,function
|
||||
remove:array
|
||||
removeNonASCII:string,regexp
|
||||
reverseString:string,array
|
||||
RGBToHex:utility
|
||||
round:math
|
||||
@ -213,7 +214,7 @@ sortedLastIndexBy:array,math,function
|
||||
splitLines:string
|
||||
spreadOver:adapter
|
||||
standardDeviation:math,array
|
||||
stripHTMLtags:string,utility,regexp
|
||||
stripHTMLTags:string,utility,regexp
|
||||
sum:math,array
|
||||
sumBy:math,array,function
|
||||
sumPower:math
|
||||
|
||||
Reference in New Issue
Block a user