Quantcast
Channel: Split String by XML tags in Java - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Split String by XML tags in Java

$
0
0

I want to write a method in Java that splits a String by XML tags like follows:

"Lorem ipsum <b>dolor</b> sit amet consetetur <b>diam</b> nonumy."

Should return the Array:

["Lorem ipsum ", "<b>dolor</b>", " sit amet consetetur ", "<b>diam</b>", " nonumy."]

This should work for every XML tag, also self closing tags like <element />.

Is there a library that does something similar in a simple way?

Thanks!


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images