I have a HTMLEditor and i have typed "My Simple Text".
@FXML
public HTMLEditor htmlEditor;
when say
htmlEditor.getHtmlText();
this return
<html><head></head><body contenteditable="true"><p style="text-align: left;"><font face="'Segoe UI'">My Simple Text</font></p></body></html>
But want text without html tag i.e.
My Simple Text
how can i do it?
This is actually dead simple with Jsoup.
public static String html2text(String html) {
return Jsoup.parse(html).text();
}
source : Remove HTML tags from a String
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With