-1

I'm new in Java I have a string which is get by StringBuilder from a HTML file, and I had split it numerous step, and now I put it into a String, lets called it alink

aLink is a String which contain <a href="http//www.google.com">Google</a>

I want to use method .split(String regex) in Java, so that I can get http://www.google.com and put it into a String variable.

My question is, how to do it, because i cannot put " into my parameter.

Thank you

Tudor
  • 61,523
  • 12
  • 102
  • 142
farissyariati
  • 365
  • 4
  • 9
  • 21

1 Answers1

9

Use \ to escape special characters:

string.split("\"");
Tudor
  • 61,523
  • 12
  • 102
  • 142