I have a string containing several urls. I want to retrieve the urls containing “thistext” and copy them into another variable named “outputlinks”. This is my code.
String links = "http://www.website1.com/thistext
http://www.website1.com/othertext
http://www.website1.com/thistext";
String outputlinks =""; // ??
Assuming you meant:
Then you can do: