java - how to use Jsoup to put text in different lines -
this question exact duplicate of:
- break line after full stop 3 answers
i using jsoup extract data website , appending text box in application. want when codes find full stop in text changes line. how can jsoup? there method this? here code:
org.jsoup.nodes.document doc = jsoup.connect("link here").get(); org.jsoup.select.elements els = doc.select("p"+"\r\n"); stringbuilder sb = new stringbuilder(); (org.jsoup.nodes.element el : els) { sb.append(el.text());} txtarea.settext(sb.tostring()); txtarea.setlinewrap(true); system.out.println(sb.tostring());
if understand want think should select this:
doc.select("p")
and append this
for (org.jsoup.nodes.element el : els) { sb.append(el.text()); sb.append(system.getproperty("line.separator")); }
but not sure meant "when codes find full stop in text"
Comments
Post a Comment