문제

How do I use the Jsoup parsing library to parse html files such that Tags should have the same effect as whitespace?

for eg.

If I parse the below string using Jsoup parse function

word<br>one<br>is<br>one<br>word

I should get

word one is one word

rather than

wordoneisoneword

올바른 솔루션이 없습니다

다른 팁

Please see here:

final String html = "word<br>one<br>is<br>one<br>word";
Document doc = Jsoup.parse(html);

String output = doc.text();

System.out.println(output);

Output:

word one is one word
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top