import java.net.URL;
import java.net.MalformedURLException;

// Replaces URLs with html hrefs codes
public class getURL {
	private static URL url = null;
	
	public  URL obtenerURL(String string) {
		String s = string;
	    // separate input by spaces ( URLs don't have spaces )
	    String [] parts = s.split("\\s+");

	    // Attempt to convert each item into an URL.   
	    for( String item : parts ) try {
	        url = new URL(item);
	        // If possible then replace with anchor...  
	    } catch (MalformedURLException e) {
	    // If there was an URL that was not it!...
	        }
	    return url;
	 }
}