I have web pages that contain text areas with HTML inside of them. For example here’s a sample of text:
var a = "some text follows<p><p>Give the following test text:</p>
<pre>abc {<br /> int size;<br /> String name;<br /> Test ( String name, int size ) {<br /> this.name = name;<br /> this.size = size;<br /> }<br>"
I want to set the META description for my web pages with the text above after the HTML has been removed.
Does anyone have any idea how I can remove the HTML from text. I don’t need have anything fancy. Maybe even just removing everything that’s within and including the angle brackets would do the trick?
This may help:
Result