1. The code is based on HTMLParser (http://htmlparser.sourceforge.net/)
2. The following is a code.
import org.htmlparser.nodes.TextNode;
import org.htmlparser.beans.StringBean;
...
public String getPlainTextString(String htmlStr)
{
StringBean sb = new StringBean();
sb.visitStringNode(new TextNode(htmlStr));
return sb.getStrings();
}
...
Example)
How I Escaped Jami G& rsquo; Shadow
=>
How I Escaped Jami G’s Shadow
0 개의 댓글:
댓글 쓰기