Here you can find the source of getPlainText(String htmlText)
Parameter | Description |
---|---|
htmlText | the HTML text to massage |
public static String getPlainText(String htmlText)
//package com.java2s; //License from project: Apache License import org.jsoup.Jsoup; import org.jsoup.nodes.Document; public class Main { /**/*from ww w. ja v a2 s . c o m*/ * Turn a hunk of text that contains HTML into plaintext. * @param htmlText the HTML text to massage * @return the text of the HTML */ public static String getPlainText(String htmlText) { Document d = Jsoup.parse(htmlText); return d.text(); } }