diff --git a/snippets/stripHTMLtags.md b/snippets/stripHTMLtags.md new file mode 100644 index 000000000..8c507d27b --- /dev/null +++ b/snippets/stripHTMLtags.md @@ -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('
lorem ipsum
'); // 'lorem ipsum' +``` diff --git a/tag_database b/tag_database index 34456499e..e52f5b958 100644 --- a/tag_database +++ b/tag_database @@ -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