A
A
adast2016-12-02 17:50:16
Java
adast, 2016-12-02 17:50:16

How to get rid of line break when parsing html with jsoup library?

Let's say we have html code:

<p>Са&shy;мы&shy;й об&shy;ыч&shy;ны&shy;й тек&shy;ст.</p>

When parsed by the jsoup library, it gives this:
And it is necessary that he brought this: The most ordinary text.
You can't just cut out the dash, it can cut what you don't need.
What is the best way to get rid of line breaks?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
al_gon, 2016-12-02
@adast

Why can't it just be?

Jsoup.parse("<p>Са&shy;мы&shy;й об&shy;ыч&shy;ны&shy;й тек&shy;ст.</p>".replaceAll("&shy;", "")).text();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question