Add stripHTMLTags

This commit is contained in:
Angelos Chalaris
2018-01-26 13:56:16 +02:00
parent 427e908c45
commit 6d0c7a1d2a
2 changed files with 14 additions and 0 deletions

13
snippets/stripHTMLtags.md Normal file
View File

@ -0,0 +1,13 @@
### stripHTMLTags
Removes HTML/XML tags from string.
Use a regular expression to remove HTML/XML tags from a string.
```js
const stripHTMLTags = str => str.replace(/<[^>]*>/g, '');
```
```js
stripHTMLTags('<p><em>lorem</em> <strong>ipsum</strong></p>'); // 'lorem ipsum'
```

View File

@ -213,6 +213,7 @@ sortedLastIndexBy:array,math,function
splitLines:string
spreadOver:adapter
standardDeviation:math,array
stripHTMLtags:string,utility,regexp
sum:math,array
sumBy:math,array,function
sumPower:math