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
|
reduceSuccessive:array,function
|
||||||
reduceWhich:array,function
|
reduceWhich:array,function
|
||||||
remove:array
|
remove:array
|
||||||
|
removeNonASCII:string,regexp
|
||||||
reverseString:string,array
|
reverseString:string,array
|
||||||
RGBToHex:utility
|
RGBToHex:utility
|
||||||
round:math
|
round:math
|
||||||
@ -213,7 +214,7 @@ sortedLastIndexBy:array,math,function
|
|||||||
splitLines:string
|
splitLines:string
|
||||||
spreadOver:adapter
|
spreadOver:adapter
|
||||||
standardDeviation:math,array
|
standardDeviation:math,array
|
||||||
stripHTMLtags:string,utility,regexp
|
stripHTMLTags:string,utility,regexp
|
||||||
sum:math,array
|
sum:math,array
|
||||||
sumBy:math,array,function
|
sumBy:math,array,function
|
||||||
sumPower:math
|
sumPower:math
|
||||||
|
|||||||
Reference in New Issue
Block a user