How to parse out html links from a huge string with html links and other text (Java).
- by Robert
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.