In fact, extract plain text from a very simple html rich text, rich text basically use html tags to text plus a variety of styles.
So just to rich text string "<.....>" tag removed, you can get plain text. We can use regular expressions to match all html tags, and replaced with a null character, as follows:
// html rich text labels removed, leaving a plain text
function getSimpleText (html) {
var = new new RE1 the RegExp ( "<+.?>", "g"); // html tags matching a regular expression, "g" a plurality of content matching the search matching
var msg = html.replace (re1, ' '); // replaced with a null character performs
return MSG;
}
java:
str = str.replaceAll("<.+?>", "");
------------------------------------
Original Address: