Skip to content
Snippets Groups Projects
Commit cdb698f0 authored by Alexander Rose's avatar Alexander Rose
Browse files

added stripTags string helper

parent c65d09f4
No related branches found
No related tags found
No related merge requests found
...@@ -73,4 +73,9 @@ export function trimCharEnd(str: string, char: string) { ...@@ -73,4 +73,9 @@ export function trimCharEnd(str: string, char: string) {
let end = str.length; let end = str.length;
while (end > 0 && str[end - 1] === char) --end; while (end > 0 && str[end - 1] === char) --end;
return (end < str.length) ? str.substring(0, end) : str; return (end < str.length) ? str.substring(0, end) : str;
}
/** Simple function to strip tags from a string */
export function stripTags(str: string) {
return str.replace(/<\/?[^>]+>/g, '')
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment