1

How can I remove special html tag from a string? Here is the string

String testString ="It's the club that is discussing this with the player's agent, but no decision has been taken," said Ancelotti, who briefly coached Beckham during a loan spell at AC Milan.
divv class="og_rss_groups">

I have to remove divv class="og_rss_groups"></divv from the above string. How it is possible?

2
  • 1
    If you are looking for parsing HTML using Java try this : htmlparser.sourceforge.net Commented Jan 3, 2012 at 12:03
  • If you put in code, you might want to post actually compiling code. Additionally, in the above code, there is no HTML tag. Commented Jan 3, 2012 at 12:07

3 Answers 3

1

You can use HTMLEntities. It will replace your quotes with HTML entities.

Sign up to request clarification or add additional context in comments.

Comments

0

String testString ="It's the club that is discussing this with the player's agent, but no decision has been taken," said Ancelotti, who briefly coached Beckham during a loan spell at AC Milan. divv class=\"og_rss_groups\">"; String result = testString.replaceAll("whattoreplace","");

Comments

0

Did you try substring function of String class ?. You should also check why the un-desired string is coming at the first place.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.