How can I remove all elements from a string apart from raw text and a single space? However, certain symbols are not getting removed, - , –, ’
Currently I use:
let descriptionString = description.replace(/(<([^>]+)>)/gi, "").replace(/[^a-zA-Z 0-9]+/g,"");
description
is a field from wordpress
which can contain anything, html, symbols, encoded chars etc.
Example content is:
Surgical Sim 8211 Kate O8217Connor Sim Lab
I need to remove 8217
- its only removed the hash at the moment.
I need to display the result in a react-native View
. I don't want to use a WebView
to render html
.
Any ideas?