Possible Duplicate:
How to detect the presence of URL in a string
Is there a way to find out user entered text is webiste url .
For example if user entered
www.yahoo.com
www.google.fr
can we detect it is a url String ?
thanks
Possible Duplicate:
How to detect the presence of URL in a string
Is there a way to find out user entered text is webiste url .
For example if user entered
www.yahoo.com
www.google.fr
can we detect it is a url String ?
thanks
try { URL url = new URL("url_string"); }
catch (MalformedURLException e) { /* invalid URL */ }
Use java.net.URL
to detect presence of url in string.
see the following thread :