0

hi I have input as follows:

"Java technology's versatility, efficiency, <br/> <br/> platform portability, and security make it the ideal technology for network computing. <div/>"

I want to remove <br/> & <div/> tag from above input.And I want output as follows: Output:-"Java technology's versatility, efficiency, platform portability, and security make it the ideal technology for network computing."

Please help me how to remove these tags,What will be the java code to get above output?

0

3 Answers 3

3

Use JSoup Cleaner to remove HTML stuff.

Example :

String unsafe = "your string containing html";
String safe = Jsoup.clean(unsafe, Whitelist.basic());
Sign up to request clarification or add additional context in comments.

Comments

2

You can try

String unsafe = "Java technology's versatility, efficiency, <br/> <br/> platform portability, and security make it the ideal technology for network computing. <div/>";
String safe = unsafe.replaceAll("<[^>]+>", "")

1 Comment

@DJ31, once you have given people enough time to answer and you have a solution you like, you can accept one of them. (Find the tick under the vote number on the left) ;)
0

Go for htmlParser.

Lots of helping hand :

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.