How to parse out html links from a huge string with html links and other text (Java).

Posted by Robert on Stack Overflow See other posts from Stack Overflow or by Robert
Published on 2010-04-22T03:43:56Z Indexed on 2010/04/22 3:53 UTC
Read the original article Hit count: 122

Filed under:
|
|
|
|

Hello, my question is how would i be able to go through a string and take out only the links and erase all the rest? I thought about using some type of delemiter, but wouldnt know how to go about using it in java. an example of what i am trying to do:

this is my String: String myString = "The file is http: // www. .com/hello.txt and the second file is " + "http: // www. .com/hello2.dat"; I would want the output to be: "http: // www. .com/hello.txt http: // www. .com/hello2.dat" or each could be added to an array, separately. I just want some ideas, id like to write the code myself but am having trouble on how to do it. Any help would be awesome.

© Stack Overflow or respective owner

Related posts about java

Related posts about links